Merge pull request #28391 from obsidiansystems/gcc-configure-platforms

gcc: Use `configurePlatforms` to control --build, --host, and --target

Changed files
+49 -16
pkgs
development
+7 -2
pkgs/development/compilers/gcc/4.5/default.nix
···
crossMingw = (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt");
crossConfigureFlags =
-
"--target=${targetPlatform.config}" +
withArch +
withCpu +
withAbi +
···
++ (optionals langVhdl [gnat])
;
+
# TODO(@Ericson2314): Always pass "--target" and always prefix.
+
configurePlatforms =
+
# TODO(@Ericson2314): Figure out what's going wrong with Arm
+
if hostPlatform == targetPlatform && targetPlatform.isArm32
+
then []
+
else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+
configureFlags = "
${if enableMultilib then "" else "--disable-multilib"}
${if enableShared then "" else "--disable-shared"}
···
${if langAda then " --enable-libada" else ""}
${if targetplatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""}
${if targetPlatform != hostPlatform then crossConfigureFlags else ""}
-
--target=${targetPlatform.config}
'';
};
+7 -2
pkgs/development/compilers/gcc/4.8/default.nix
···
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
in
-
"--target=${targetPlatform.config}" +
withArch +
withCpu +
withAbi +
···
dontDisableStatic = true;
+
# TODO(@Ericson2314): Always pass "--target" and always prefix.
+
configurePlatforms =
+
# TODO(@Ericson2314): Figure out what's going wrong with Arm
+
if hostPlatform == targetPlatform && targetPlatform.isArm32
+
then []
+
else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+
configureFlags = "
${if hostPlatform.isSunOS then
" --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
···
)
}
${if langAda then " --enable-libada" else ""}
-
--target=${targetPlatform.config}
${xwithArch}
${xwithCpu}
${xwithAbi}
+7 -2
pkgs/development/compilers/gcc/4.9/default.nix
···
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
in
-
"--target=${targetPlatform.config}" +
withArch +
withCpu +
withAbi +
···
dontDisableStatic = true;
+
# TODO(@Ericson2314): Always pass "--target" and always prefix.
+
configurePlatforms =
+
# TODO(@Ericson2314): Figure out what's going wrong with Arm
+
if hostPlatform == targetPlatform && targetPlatform.isArm32
+
then []
+
else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+
configureFlags = "
${if hostPlatform.isSunOS then
" --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
···
)
}
${if langAda then " --enable-libada" else ""}
-
--target=${targetPlatform.config}
${xwithArch}
${xwithCpu}
${xwithAbi}
+7 -4
pkgs/development/compilers/gcc/5/default.nix
···
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
in
-
"--target=${targetPlatform.config}" +
withArch +
withCpu +
withAbi +
···
dontDisableStatic = true;
+
# TODO(@Ericson2314): Always pass "--target" and always prefix.
+
configurePlatforms =
+
# TODO(@Ericson2314): Figure out what's going wrong with Arm
+
if hostPlatform == targetPlatform && targetPlatform.isArm32
+
then []
+
else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+
configureFlags = "
${if hostPlatform.isSunOS then
" --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
···
)
}
${if langAda then " --enable-libada" else ""}
-
--build=${buildPlatform.config}
-
--host=${hostPlatform.config}
-
--target=${targetPlatform.config}
${xwithArch}
${xwithCpu}
${xwithAbi}
+7 -2
pkgs/development/compilers/gcc/6/default.nix
···
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
in
-
"--target=${targetPlatform.config}" +
withArch +
withCpu +
withAbi +
···
dontDisableStatic = true;
+
# TODO(@Ericson2314): Always pass "--target" and always prefix.
+
configurePlatforms =
+
# TODO(@Ericson2314): Figure out what's going wrong with Arm
+
if hostPlatform == targetPlatform && targetPlatform.isArm32
+
then []
+
else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+
configureFlags = "
${if hostPlatform.isSunOS then
" --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
···
)
}
${if langAda then " --enable-libada" else ""}
-
--target=${targetPlatform.config}
${xwithArch}
${xwithCpu}
${xwithAbi}
+7 -2
pkgs/development/compilers/gcc/7/default.nix
···
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
in
-
"--target=${targetPlatform.config}" +
withArch +
withCpu +
withAbi +
···
dontDisableStatic = true;
+
# TODO(@Ericson2314): Always pass "--target" and always prefix.
+
configurePlatforms =
+
# TODO(@Ericson2314): Figure out what's going wrong with Arm
+
if hostPlatform == targetPlatform && targetPlatform.isArm32
+
then []
+
else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+
configureFlags = "
${if hostPlatform.isSunOS then
" --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
···
)
}
${if langAda then " --enable-libada" else ""}
-
--target=${targetPlatform.config}
${xwithArch}
${xwithCpu}
${xwithAbi}
+7 -2
pkgs/development/compilers/gcc/snapshot/default.nix
···
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
in
-
"--target=${targetPlatform.config}" +
withArch +
withCpu +
withAbi +
···
dontDisableStatic = true;
+
# TODO(@Ericson2314): Always pass "--target" and always prefix.
+
configurePlatforms =
+
# TODO(@Ericson2314): Figure out what's going wrong with Arm
+
if hostPlatform == targetPlatform && targetPlatform.isArm32
+
then []
+
else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+
configureFlags = "
${if hostPlatform.isSunOS then
" --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
···
)
}
${if langAda then " --enable-libada" else ""}
-
--target=${targetPlatform.config}
${xwithArch}
${xwithCpu}
${xwithAbi}