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

gcc: Use `configurePlatforms` to control --build, --host, and --target
This commit is contained in:
John Ericson 2017-08-23 15:47:24 -04:00 committed by GitHub
commit 46930ef3e6
7 changed files with 49 additions and 16 deletions

View File

@ -73,7 +73,6 @@ let version = "4.5.4";
crossMingw = (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"); crossMingw = (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt");
crossConfigureFlags = crossConfigureFlags =
"--target=${targetPlatform.config}" +
withArch + withArch +
withCpu + withCpu +
withAbi + withAbi +
@ -231,6 +230,13 @@ stdenv.mkDerivation ({
++ (optionals langVhdl [gnat]) ++ (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 = " configureFlags = "
${if enableMultilib then "" else "--disable-multilib"} ${if enableMultilib then "" else "--disable-multilib"}
${if enableShared then "" else "--disable-shared"} ${if enableShared then "" else "--disable-shared"}
@ -313,7 +319,6 @@ stdenv.mkDerivation ({
${if langAda then " --enable-libada" else ""} ${if langAda then " --enable-libada" else ""}
${if targetplatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetplatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""}
${if targetPlatform != hostPlatform then crossConfigureFlags else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""}
--target=${targetPlatform.config}
''; '';
}; };

View File

@ -142,7 +142,6 @@ let version = "4.8.5";
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
in in
"--target=${targetPlatform.config}" +
withArch + withArch +
withCpu + withCpu +
withAbi + withAbi +
@ -317,6 +316,13 @@ stdenv.mkDerivation ({
dontDisableStatic = true; 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 = " configureFlags = "
${if hostPlatform.isSunOS then ${if hostPlatform.isSunOS then
" --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " + " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
@ -436,7 +442,6 @@ stdenv.mkDerivation ({
) )
} }
${if langAda then " --enable-libada" else ""} ${if langAda then " --enable-libada" else ""}
--target=${targetPlatform.config}
${xwithArch} ${xwithArch}
${xwithCpu} ${xwithCpu}
${xwithAbi} ${xwithAbi}

View File

@ -136,7 +136,6 @@ let version = "4.9.4";
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
in in
"--target=${targetPlatform.config}" +
withArch + withArch +
withCpu + withCpu +
withAbi + withAbi +
@ -317,6 +316,13 @@ stdenv.mkDerivation ({
dontDisableStatic = true; 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 = " configureFlags = "
${if hostPlatform.isSunOS then ${if hostPlatform.isSunOS then
" --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " + " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
@ -434,7 +440,6 @@ stdenv.mkDerivation ({
) )
} }
${if langAda then " --enable-libada" else ""} ${if langAda then " --enable-libada" else ""}
--target=${targetPlatform.config}
${xwithArch} ${xwithArch}
${xwithCpu} ${xwithCpu}
${xwithAbi} ${xwithAbi}

View File

@ -142,7 +142,6 @@ let version = "5.4.0";
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
in in
"--target=${targetPlatform.config}" +
withArch + withArch +
withCpu + withCpu +
withAbi + withAbi +
@ -334,6 +333,13 @@ stdenv.mkDerivation ({
dontDisableStatic = true; 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 = " configureFlags = "
${if hostPlatform.isSunOS then ${if hostPlatform.isSunOS then
" --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " + " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
@ -451,9 +457,6 @@ stdenv.mkDerivation ({
) )
} }
${if langAda then " --enable-libada" else ""} ${if langAda then " --enable-libada" else ""}
--build=${buildPlatform.config}
--host=${hostPlatform.config}
--target=${targetPlatform.config}
${xwithArch} ${xwithArch}
${xwithCpu} ${xwithCpu}
${xwithAbi} ${xwithAbi}

View File

@ -136,7 +136,6 @@ let version = "6.4.0";
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
in in
"--target=${targetPlatform.config}" +
withArch + withArch +
withCpu + withCpu +
withAbi + withAbi +
@ -326,6 +325,13 @@ stdenv.mkDerivation ({
dontDisableStatic = true; 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 = " configureFlags = "
${if hostPlatform.isSunOS then ${if hostPlatform.isSunOS then
" --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " + " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
@ -443,7 +449,6 @@ stdenv.mkDerivation ({
) )
} }
${if langAda then " --enable-libada" else ""} ${if langAda then " --enable-libada" else ""}
--target=${targetPlatform.config}
${xwithArch} ${xwithArch}
${xwithCpu} ${xwithCpu}
${xwithAbi} ${xwithAbi}

View File

@ -137,7 +137,6 @@ let version = "7.1.0";
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
in in
"--target=${targetPlatform.config}" +
withArch + withArch +
withCpu + withCpu +
withAbi + withAbi +
@ -328,6 +327,13 @@ stdenv.mkDerivation ({
dontDisableStatic = true; 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 = " configureFlags = "
${if hostPlatform.isSunOS then ${if hostPlatform.isSunOS then
" --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " + " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
@ -445,7 +451,6 @@ stdenv.mkDerivation ({
) )
} }
${if langAda then " --enable-libada" else ""} ${if langAda then " --enable-libada" else ""}
--target=${targetPlatform.config}
${xwithArch} ${xwithArch}
${xwithCpu} ${xwithCpu}
${xwithAbi} ${xwithAbi}

View File

@ -137,7 +137,6 @@ let version = "7-20170409";
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
in in
"--target=${targetPlatform.config}" +
withArch + withArch +
withCpu + withCpu +
withAbi + withAbi +
@ -315,6 +314,13 @@ stdenv.mkDerivation ({
dontDisableStatic = true; 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 = " configureFlags = "
${if hostPlatform.isSunOS then ${if hostPlatform.isSunOS then
" --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " + " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
@ -432,7 +438,6 @@ stdenv.mkDerivation ({
) )
} }
${if langAda then " --enable-libada" else ""} ${if langAda then " --enable-libada" else ""}
--target=${targetPlatform.config}
${xwithArch} ${xwithArch}
${xwithCpu} ${xwithCpu}
${xwithAbi} ${xwithAbi}