From 1c1207220f06b751a42346f33d09582e66999a6d Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 14 Nov 2017 16:08:46 -0500 Subject: gcc: Refactor treatment of configure flags Previously configureFlags was defined as one giant interpolated string. Here we refactor this definition to instead use the usual stdenv string combinators. This seems more in-line with the average nixpkgs expression and it seems a bit more natural to things of these as lists of flags rather than monolithic strings. --- pkgs/development/compilers/gcc/7/default.nix | 350 ++++++++++++++------------- 1 file changed, 177 insertions(+), 173 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 3a7c0eb64437..e44b32ef9d37 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -98,108 +98,90 @@ let version = "7.2.0"; javaAwtGtk = langJava && x11Support; /* Platform flags */ - platformFlags = let - gccArch = stdenv.platform.gcc.arch or null; - gccCpu = stdenv.platform.gcc.cpu or null; - gccAbi = stdenv.platform.gcc.abi or null; - gccFpu = stdenv.platform.gcc.fpu or null; - gccFloat = stdenv.platform.gcc.float or null; - gccMode = stdenv.platform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode; - - /* Cross-gcc settings */ + mkPlatformFlags = platform: let + gccArch = platform.gcc.arch or null; + gccCpu = platform.gcc.cpu or null; + gccAbi = platform.gcc.abi or null; + gccFpu = platform.gcc.fpu or null; + gccFloat = platform.gcc.float or null; + gccMode = platform.gcc.mode or null; + in + optional (gccArch != null) "--with-arch=${gccArch}" ++ + optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ + optional (gccAbi != null) "--with-abi=${gccAbi}" ++ + optional (gccFpu != null) "--with-fpu=${gccFpu}" ++ + optional (gccFloat != null) "--with-float=${gccFloat}" ++ + optional (gccMode != null) "--with-mode=${gccMode}"; + + /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; - crossConfigureFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode + + crossConfigureFlags = + mkPlatformFlags targetPlatform ++ + # Ensure that -print-prog-name is able to find the correct programs. - " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + - " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" + + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ (if crossMingw && crossStageStatic then - " --with-headers=${libcCross}/include" + - " --with-gcc" + - " --with-gnu-as" + - " --with-gnu-ld" + - " --with-gnu-ld" + - " --disable-shared" + - " --disable-nls" + - " --disable-debug" + - " --enable-sjlj-exceptions" + - " --enable-threads=win32" + - " --disable-win32-registry" - else if crossStageStatic then - " --disable-libssp --disable-nls" + - " --without-headers" + - " --disable-threads " + - " --disable-libgomp " + - " --disable-libquadmath" + - " --disable-shared" + - " --disable-libatomic " + # libatomic requires libc - " --disable-decimal-float" # libdecnumber requires libc - else - (if crossDarwin then " --with-sysroot=${getLib libcCross}/share/sysroot" - else " --with-headers=${getDev libcCross}/include") + - # Ensure that -print-prog-name is able to find the correct programs. - " --enable-__cxa_atexit" + - " --enable-long-long" + - (if crossMingw then - " --enable-threads=win32" + - " --enable-sjlj-exceptions" + - " --enable-hash-synchronization" + - " --disable-libssp" + - " --disable-nls" + - " --with-dwarf2" + + [ "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then + [ "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads " + "--disable-libgomp " + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic " # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else + (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] + else ["--with-headers=${getDev libcCross}/include"]) ++ + [ "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" # I think noone uses shared gcc libs in mingw, so we better do the same. # In any case, mingw32 g++ linking is broken by default with shared libs, # unless adding "-lsupc++" to any linking command. I don't know why. - " --disable-shared" + + "--disable-shared" # To keep ABI compatibility with upstream mingw-w64 - " --enable-fully-dynamic-string" - else (if targetPlatform.libc == "uclibc" then + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ # libsanitizer requires netrom/netrom.h which is not # available in uclibc. - " --disable-libsanitizer" + + "--disable-libsanitizer" # In uclibc cases, libgomp needs an additional '-ldl' # and as I don't know how to pass it, I disable libgomp. - " --disable-libgomp" else "") + - " --enable-threads=posix" + - " --enable-nls" + - " --disable-decimal-float") # No final libdecnumber (it may work only in 386) + "--disable-libgomp" + ] ++ + [ "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ]) ); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; - bootstrap = targetPlatform == hostPlatform; + bootstrap = targetPlatform == hostPlatform; in @@ -335,62 +317,86 @@ stdenv.mkDerivation ({ 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 " + - # On Illumos/Solaris GNU as is preferred - " --with-gnu-as --without-gnu-ld " - else ""} - --enable-lto - ${if enableMultilib then "--enable-multilib --disable-libquadmath" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if enablePlugin then "--enable-plugin" else "--disable-plugin"} - ${optionalString (isl != null) "--with-isl=${isl}"} - ${if langJava then - "--with-ecj-jar=${javaEcj} " + + configureFlags = + # Basic dependencies + [ + "--with-gmp-include=${gmp.dev}/include" + "--with-gmp-lib=${gmp.out}/lib" + "--with-mpfr-include=${mpfr.dev}/include" + "--with-mpfr-lib=${mpfr.out}/lib" + "--with-mpc=${libmpc}" + ] ++ + optional (libelf != null) "--with-libelf=${libelf}" ++ + + # Basic configuration + [ + "--enable-lto" + "--disable-libstdcxx-pch" + "--without-included-gettext" + "--with-system-zlib" + "--enable-static" + "--enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ++ optional langGo "go" + ++ optional langObjC "objc" + ++ optional langObjCpp "obj-c++" + ++ optionals crossDarwin [ "objc" "obj-c++" ] + ) + ) + }" + ] ++ + + (if enableMultilib + then ["--enable-multilib" "--disable-libquadmath"] + else ["--disable-multilib"]) ++ + optional (!enableShared) "--disable-shared" ++ + (if enablePlugin + then ["--enable-plugin"] + else ["--disable-plugin"]) ++ + + # Optional features + optional (isl != null) "--with-isl=${isl}" ++ + + # Java options + optionals langJava [ + "--with-ecj-jar=${javaEcj} " # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " - else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""} - --with-gmp-include=${gmp.dev}/include - --with-gmp-lib=${gmp.out}/lib - --with-mpfr-include=${mpfr.dev}/include - --with-mpfr-lib=${mpfr.out}/lib - --with-mpc=${libmpc} - ${if libelf != null then "--with-libelf=${libelf}" else ""} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-static - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ++ optional langObjC "objc" - ++ optional langObjCpp "obj-c++" - ++ optionals crossDarwin [ "objc" "obj-c++" ] - ) - ) - } - ${if targetPlatform == hostPlatform - then if hostPlatform.isDarwin - then " --with-native-system-header-dir=${darwin.usr-include}" - else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include" - else ""} - ${if langAda then " --enable-libada" else ""} - ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} - ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} - ${if !bootstrap then "--disable-bootstrap" else ""} - ${if targetPlatform == hostPlatform then platformFlags else ""} - "; + ] ++ + optional javaAwtGtk "--enable-java-awt=gtk" ++ + optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ + + # Ada + optional langAda "--enable-libada" ++ + + # Cross-compilation + optional (targetPlatform == hostPlatform) ( + let incDir = if hostPlatform.isDarwin + then "${darwin.usr-include}" + else "${getDev stdenv.cc.libc}/include"; + in "--with-native-system-header-dir=${incDir}" + ) ++ + + optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++ + optional (targetPlatform != hostPlatform) crossConfigureFlags ++ + optional (!bootstrap) "--disable-bootstrap" ++ + + # Platform-specific flags + optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ + optionals hostPlatform.isSunOS [ + "--enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" + # On Illumos/Solaris GNU as is preferred + "--with-gnu-as --without-gnu-ld" + ] + ; targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; @@ -403,17 +409,13 @@ stdenv.mkDerivation ({ then "install-strip" else "install"; + /* For cross-built gcc (build != host == target) */ crossAttrs = let xgccArch = targetPlatform.gcc.arch or null; xgccCpu = targetPlatform.gcc.cpu or null; xgccAbi = targetPlatform.gcc.abi or null; xgccFpu = targetPlatform.gcc.fpu or null; xgccFloat = targetPlatform.gcc.float or null; - xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; - xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; - xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; - xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; - xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { AR = "${targetPlatform.config}-ar"; LD = "${targetPlatform.config}-ld"; @@ -427,37 +429,39 @@ stdenv.mkDerivation ({ # If we are making a cross compiler, targetPlatform != hostPlatform NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; dontStrip = true; - configureFlags = '' - ${if enableMultilib then "" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""} - --with-gmp=${gmp.crossDrv} - --with-mpfr=${mpfr.crossDrv} - --with-mpc=${libmpc.crossDrv} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" + configureFlags = + optional (!enableMultilib) "--disable-multilib" ++ + optional (!enableShared) "--disable-shared" ++ + optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ + optional javaAwtGtk "--enable-java-awt=gtk" ++ + optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ + [ + "--with-gmp=${gmp.crossDrv}" + "--with-mpfr=${mpfr.crossDrv}" + "--with-mpc=${libmpc.crossDrv}" + "--disable-libstdcxx-pch" + "--without-included-gettext" + "--with-system-zlib" + "--enable-languages=${ + concatStrings (intersperse "," + ( optional langC "c" + ++ optional langCC "c++" + ++ optional langFortran "fortran" + ++ optional langJava "java" + ++ optional langAda "ada" + ++ optional langVhdl "vhdl" + ++ optional langGo "go" + ) ) - ) - } - ${if langAda then " --enable-libada" else ""} - ${xwithArch} - ${xwithCpu} - ${xwithAbi} - ${xwithFpu} - ${xwithFloat} - ''; + }" + ] ++ + optional langAda "--enable-libada" ++ + optional (xgccArch != null) "--with-arch=${xgccArch}" ++ + optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++ + optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++ + optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++ + optional (xgccFloat != null) "--with-float=${xgccFloat}" + ; buildFlags = ""; }; -- cgit 1.4.1 From ab77a6bb1e7d2ff475210ad392f1a9bd1bb6ba3a Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 14 Nov 2017 18:32:50 -0500 Subject: gcc: Misc indentation and whitespace-in-string fixes --- pkgs/development/compilers/gcc/4.5/default.nix | 28 +++-- pkgs/development/compilers/gcc/4.8/default.nix | 129 +++++++++---------- pkgs/development/compilers/gcc/4.9/default.nix | 137 +++++++++++---------- pkgs/development/compilers/gcc/5/default.nix | 128 +++++++++---------- pkgs/development/compilers/gcc/6/default.nix | 124 +++++++++---------- pkgs/development/compilers/gcc/7/default.nix | 129 ++++++++++--------- .../development/compilers/gcc/snapshot/default.nix | 129 ++++++++++--------- 7 files changed, 404 insertions(+), 400 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 69022c2aa3d8..088a64ff5438 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -74,8 +74,8 @@ let version = "4.5.4"; optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ optional (gccAbi != null) "--with-abi=${gccAbi}" ++ # Ensure that -print-prog-name is able to find the correct programs. - [ " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" - " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ (if crossMingw && crossStageStatic then [ "--with-headers=${libcCross}/include" "--with-gcc" @@ -88,19 +88,21 @@ let version = "4.5.4"; "--enable-sjlj-exceptions" "--enable-threads=win32" "--disable-win32-registry" - ] else if crossStageStatic then [ - "--disable-libssp --disable-nls" + ] else if crossStageStatic then [ + "--disable-libssp" + "--disable-nls" "--without-headers" "--disable-threads" "--disable-libmudflap" - "--disable-libgomp " + "--disable-libgomp" "--disable-shared" "--disable-decimal-float" # libdecnumber requires libc - ] else [ + ] else [ "--with-headers=${libcCross}/include" "--enable-__cxa_atexit" "--enable-long-long" - ] ++ (if crossMingw then [ + ] ++ + (if crossMingw then [ "--enable-threads=win32" "--enable-sjlj-exceptions" "--enable-hash-synchronization" @@ -108,12 +110,11 @@ let version = "4.5.4"; "--disable-libssp" "--disable-nls" "--with-dwarf2" - ] else [ + ] else [ "--enable-threads=posix" "--enable-nls" - "--disable-decimal-float" - ]) # No final libdecnumber (it may work only in 386) - ); + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -274,11 +275,12 @@ stdenv.mkDerivation ({ # Java options optionals langJava [ - "--with-ecj-jar=${javaEcj} " + "--with-ecj-jar=${javaEcj}" # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . - "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " + "--enable-java-home" + "--with-java-home=\${prefix}/lib/jvm/jre" ] ++ optional javaAwtGtk "--enable-java-awt=gtk" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 7cba8296d83a..7003ace28905 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -123,68 +123,66 @@ let version = "4.8.5"; optional (gccFloat != null) "--with-float=${gccFloat}" ++ optional (gccMode != null) "--with-mode=${gccMode}"; - /* Cross-gcc settings (build == host != target) */ /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ - - # Ensure that -print-prog-name is able to find the correct programs. - [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" - "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then - [ "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - ] else if crossStageStatic then - [ "--disable-libssp --disable-nls" - "--without-headers" - "--disable-threads " - "--disable-libgomp " - "--disable-libquadmath" - "--disable-shared" - "--disable-libatomic " # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc - ] else - (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] - else ["--with-headers=${getDev libcCross}/include"]) ++ - [ "--enable-__cxa_atexit" - "--enable-long-long" - ] ++ - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--disable-libssp" - "--disable-nls" - "--with-dwarf2" - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - "--disable-shared" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc") [ - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - ] ++ - [ "--enable-threads=posix" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ] - ) - ); + mkPlatformFlags targetPlatform ++ + + # Ensure that -print-prog-name is able to find the correct programs. + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ + (if crossMingw && crossStageStatic then [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then [ + "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads" + "--disable-libgomp" + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic" # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else [ + (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" + else "--with-headers=${getDev libcCross}/include") + "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" + # I think noone uses shared gcc libs in mingw, so we better do the same. + # In any case, mingw32 g++ linking is broken by default with shared libs, + # unless adding "-lsupc++" to any linking command. I don't know why. + "--disable-shared" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ [ + "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -347,7 +345,11 @@ stdenv.mkDerivation ({ # Optional features optional (isl != null) "--with-isl=${isl}" ++ - optional (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl" ++ + optionals (cloog != null) [ + "--with-cloog=${cloog}" + "--disable-cloog-version-check" + "--enable-cloog-backend=isl" + ] ++ (if enableMultilib then ["--enable-multilib" "--disable-libquadmath"] @@ -359,11 +361,12 @@ stdenv.mkDerivation ({ # Java options optionals langJava [ - "--with-ecj-jar=${javaEcj} " + "--with-ecj-jar=${javaEcj}" # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . - "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " + "--enable-java-home" + "--with-java-home=\${prefix}/lib/jvm/jre" ] ++ optional javaAwtGtk "--enable-java-awt=gtk" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ @@ -386,9 +389,9 @@ stdenv.mkDerivation ({ # Platform-specific flags optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optionals hostPlatform.isSunOS [ - "--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" # On Illumos/Solaris GNU as is preferred - "--with-gnu-as --without-gnu-ld" + "--with-gnu-as" "--without-gnu-ld" ] ; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 98df530d884c..362670ff5dbd 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -118,67 +118,65 @@ let version = "4.9.4"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ - - # Ensure that -print-prog-name is able to find the correct programs. - [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" - "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then - [ "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - ] else if crossStageStatic then - [ "--disable-libssp" - "--disable-nls" - "--without-headers" - "--disable-threads " - "--disable-libgomp " - "--disable-libquadmath" - "--disable-shared" - "--disable-libatomic " # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc - ] else - (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] - else ["--with-headers=${getDev libcCross}/include"]) ++ - [ "--enable-__cxa_atexit" - "--enable-long-long" - ] ++ - - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--disable-libssp" - "--disable-nls" - "--with-dwarf2" - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - "--disable-shared" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - ] ++ - [ "--enable-threads=posix" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ]) - ); + mkPlatformFlags targetPlatform ++ + + # Ensure that -print-prog-name is able to find the correct programs. + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ + (if crossMingw && crossStageStatic then [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then [ + "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads" + "--disable-libgomp" + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic" # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else [ + (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" + else "--with-headers=${getDev libcCross}/include") + "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" + # I think noone uses shared gcc libs in mingw, so we better do the same. + # In any case, mingw32 g++ linking is broken by default with shared libs, + # unless adding "-lsupc++" to any linking command. I don't know why. + "--disable-shared" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ [ + "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -353,15 +351,20 @@ stdenv.mkDerivation ({ # Optional features optional (isl != null) "--with-isl=${isl}" ++ - optional (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl" ++ + optionals (cloog != null) [ + "--with-cloog=${cloog}" + "--disable-cloog-version-check" + "--enable-cloog-backend=isl" + ] ++ # Java options optionals langJava [ - "--with-ecj-jar=${javaEcj} " + "--with-ecj-jar=${javaEcj}" # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . - "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " + "--enable-java-home" + "--with-java-home=\${prefix}/lib/jvm/jre" ] ++ optional javaAwtGtk "--enable-java-awt=gtk" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ @@ -384,9 +387,9 @@ stdenv.mkDerivation ({ # Platform-specific flags optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optionals hostPlatform.isSunOS [ - "--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" # On Illumos/Solaris GNU as is preferred - "--with-gnu-as --without-gnu-ld" + "--with-gnu-as" "--without-gnu-ld" ] ; @@ -427,7 +430,7 @@ stdenv.mkDerivation ({ optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ optional javaAwtGtk "--enable-java-awt=gtk" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ - optional (cloog != null) "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" ++ + optional (cloog != null) "--with-cloog=${cloog.crossDrv}" "--enable-cloog-backend=isl" ++ [ "--with-gmp=${gmp.crossDrv}" "--with-mpfr=${mpfr.crossDrv}" diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index fe9735d1fd62..c9b49c0ede63 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -122,66 +122,65 @@ let version = "5.5.0"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ - - # Ensure that -print-prog-name is able to find the correct programs. - [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" - "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then - [ "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - ] else if crossStageStatic then - [ "--disable-libssp --disable-nls" - "--without-headers" - "--disable-threads " - "--disable-libgomp " - "--disable-libquadmath" - "--disable-shared" - "--disable-libatomic " # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc - ] else - (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] - else ["--with-headers=${getDev libcCross}/include"]) ++ - [ "--enable-__cxa_atexit" - "--enable-long-long" - ] ++ - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--disable-libssp" - "--disable-nls" - "--with-dwarf2" - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - "--disable-shared" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - ] ++ - [ "--enable-threads=posix" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ] - ) - ); + mkPlatformFlags targetPlatform ++ + + # Ensure that -print-prog-name is able to find the correct programs. + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ + (if crossMingw && crossStageStatic then [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then [ + "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads" + "--disable-libgomp" + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic" # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else [ + (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" + else "--with-headers=${getDev libcCross}/include") + "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" + # I think noone uses shared gcc libs in mingw, so we better do the same. + # In any case, mingw32 g++ linking is broken by default with shared libs, + # unless adding "-lsupc++" to any linking command. I don't know why. + "--disable-shared" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ [ + "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -370,11 +369,12 @@ stdenv.mkDerivation ({ # Java options optionals langJava [ - "--with-ecj-jar=${javaEcj} " + "--with-ecj-jar=${javaEcj}" # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . - "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " + "--enable-java-home" + "--with-java-home=\${prefix}/lib/jvm/jre" ] ++ optional javaAwtGtk "--enable-java-awt=gtk" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ @@ -397,9 +397,9 @@ stdenv.mkDerivation ({ # Platform-specific flags optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optionals hostPlatform.isSunOS [ - "--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" # On Illumos/Solaris GNU as is preferred - "--with-gnu-as --without-gnu-ld" + "--with-gnu-as" "--without-gnu-ld" ] ; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index f0d2ab6a914c..a68946a6f345 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -119,67 +119,65 @@ let version = "6.4.0"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ - - # Ensure that -print-prog-name is able to find the correct programs. - [ " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" - " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then - [ "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - ] else if crossStageStatic then [ - "--disable-libssp" - "--disable-nls" - "--without-headers" - "--disable-threads" - "--disable-libgomp" - "--disable-libquadmath" - "--disable-shared" - "--disable-libatomic" # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc + mkPlatformFlags targetPlatform ++ + + # Ensure that -print-prog-name is able to find the correct programs. + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ + (if crossMingw && crossStageStatic then [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then [ + "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads" + "--disable-libgomp" + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic" # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else [ + (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" + else "--with-headers=${getDev libcCross}/include") + "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" + # I think noone uses shared gcc libs in mingw, so we better do the same. + # In any case, mingw32 g++ linking is broken by default with shared libs, + # unless adding "-lsupc++" to any linking command. I don't know why. + "--disable-shared" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" ] else - (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] - else ["--with-headers=${getDev libcCross}/include"]) ++ - - [ "--enable-__cxa_atexit" - "--enable-long-long" - ] ++ - - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--disable-libssp" - "--disable-nls" - "--with-dwarf2" - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - "--disable-shared" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" ] ++ - [ "--enable-threads=posix" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ]) - ); + optionals (targetPlatform.libc == "uclibc") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ [ + "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -372,7 +370,7 @@ stdenv.mkDerivation ({ # Java options optionals langJava [ - "--with-ecj-jar=${javaEcj} " + "--with-ecj-jar=${javaEcj}" # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . @@ -399,9 +397,9 @@ stdenv.mkDerivation ({ # Platform-specific flags optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optionals (hostPlatform.isSunOS) [ - " --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" # On Illumos/Solaris GNU as is preferred - " --with-gnu-as --without-gnu-ld" + "--with-gnu-as" "--without-gnu-ld" ] ; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index e44b32ef9d37..c201ca6373b7 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -117,67 +117,65 @@ let version = "7.2.0"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ - - # Ensure that -print-prog-name is able to find the correct programs. - [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" - "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then - [ "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - ] else if crossStageStatic then - [ "--disable-libssp" - "--disable-nls" - "--without-headers" - "--disable-threads " - "--disable-libgomp " - "--disable-libquadmath" - "--disable-shared" - "--disable-libatomic " # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc - ] else - (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] - else ["--with-headers=${getDev libcCross}/include"]) ++ - [ "--enable-__cxa_atexit" - "--enable-long-long" - ] ++ - - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--disable-libssp" - "--disable-nls" - "--with-dwarf2" - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - "--disable-shared" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - ] ++ - [ "--enable-threads=posix" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ]) - ); + mkPlatformFlags targetPlatform ++ + + # Ensure that -print-prog-name is able to find the correct programs. + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ + (if crossMingw && crossStageStatic then [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then [ + "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads" + "--disable-libgomp" + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic" # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else [ + (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" + else "--with-headers=${getDev libcCross}/include") + "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" + # I think noone uses shared gcc libs in mingw, so we better do the same. + # In any case, mingw32 g++ linking is broken by default with shared libs, + # unless adding "-lsupc++" to any linking command. I don't know why. + "--disable-shared" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ [ + "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -365,11 +363,12 @@ stdenv.mkDerivation ({ # Java options optionals langJava [ - "--with-ecj-jar=${javaEcj} " + "--with-ecj-jar=${javaEcj}" # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . - "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " + "--enable-java-home" + "--with-java-home=\${prefix}/lib/jvm/jre" ] ++ optional javaAwtGtk "--enable-java-awt=gtk" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ @@ -392,9 +391,9 @@ stdenv.mkDerivation ({ # Platform-specific flags optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optionals hostPlatform.isSunOS [ - "--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" # On Illumos/Solaris GNU as is preferred - "--with-gnu-as --without-gnu-ld" + "--with-gnu-as" "--without-gnu-ld" ] ; diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index ed127effd7ed..2e0a49957c02 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -117,67 +117,65 @@ let version = "7-20170409"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = - mkPlatformFlags targetPlatform ++ - - # Ensure that -print-prog-name is able to find the correct programs. - [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" - "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then - [ "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - ] else if crossStageStatic then - [ "--disable-libssp" - "--disable-nls" - "--without-headers" - "--disable-threads " - "--disable-libgomp " - "--disable-libquadmath" - "--disable-shared" - "--disable-libatomic " # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc - ] else - (if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] - else ["--with-headers=${getDev libcCross}/include"]) ++ - [ "--enable-__cxa_atexit" - "--enable-long-long" - ] ++ - - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--disable-libssp" - "--disable-nls" - "--with-dwarf2" - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - "--disable-shared" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - ] ++ - [ "--enable-threads=posix" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ]) - ); + mkPlatformFlags targetPlatform ++ + + # Ensure that -print-prog-name is able to find the correct programs. + [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" + "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ + (if crossMingw && crossStageStatic then [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--with-gnu-ld" + "--disable-shared" + "--disable-nls" + "--disable-debug" + "--enable-sjlj-exceptions" + "--enable-threads=win32" + "--disable-win32-registry" + ] else if crossStageStatic then [ + "--disable-libssp" + "--disable-nls" + "--without-headers" + "--disable-threads" + "--disable-libgomp" + "--disable-libquadmath" + "--disable-shared" + "--disable-libatomic" # libatomic requires libc + "--disable-decimal-float" # libdecnumber requires libc + ] else [ + (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" + else "--with-headers=${getDev libcCross}/include") + "--enable-__cxa_atexit" + "--enable-long-long" + ] ++ + (if crossMingw then [ + "--enable-threads=win32" + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--disable-libssp" + "--disable-nls" + "--with-dwarf2" + # I think noone uses shared gcc libs in mingw, so we better do the same. + # In any case, mingw32 g++ linking is broken by default with shared libs, + # unless adding "-lsupc++" to any linking command. I don't know why. + "--disable-shared" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] else + optionals (targetPlatform.libc == "uclibc") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ [ + "--enable-threads=posix" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -352,11 +350,12 @@ stdenv.mkDerivation ({ # Java options optionals langJava [ - "--with-ecj-jar=${javaEcj} " + "--with-ecj-jar=${javaEcj}" # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # . - "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " + "--enable-java-home" + "--with-java-home=\${prefix}/lib/jvm/jre" ] ++ optional javaAwtGtk "--enable-java-awt=gtk" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ @@ -379,9 +378,9 @@ stdenv.mkDerivation ({ # Platform-specific flags optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optionals hostPlatform.isSunOS [ - "--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" # On Illumos/Solaris GNU as is preferred - "--with-gnu-as --without-gnu-ld" + "--with-gnu-as" "--without-gnu-ld" ] ; -- cgit 1.4.1 From 2fdca4db69c845771968a4976e19d05a52975ed8 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 29 Nov 2017 20:10:24 -0500 Subject: gcc: Lock down more tools for cross-builds That is, build != host == target --- pkgs/development/compilers/gcc/4.5/default.nix | 33 ++++++++++++++++++++-- pkgs/development/compilers/gcc/4.8/default.nix | 33 ++++++++++++++++++++-- pkgs/development/compilers/gcc/4.9/default.nix | 33 ++++++++++++++++++++-- pkgs/development/compilers/gcc/5/default.nix | 33 ++++++++++++++++++++-- pkgs/development/compilers/gcc/6/default.nix | 33 ++++++++++++++++++++-- pkgs/development/compilers/gcc/7/default.nix | 33 ++++++++++++++++++++-- .../development/compilers/gcc/snapshot/default.nix | 33 ++++++++++++++++++++-- 7 files changed, 217 insertions(+), 14 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 67981ad1056e..114fc4d8307c 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -273,14 +273,43 @@ stdenv.mkDerivation ({ targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; crossAttrs = { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index de9d3165b55e..1a1400a57a80 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -391,14 +391,43 @@ stdenv.mkDerivation ({ xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index c5bebdf33003..8842be6a49ba 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -397,14 +397,43 @@ stdenv.mkDerivation ({ xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index b4a74300d366..38bc0dff4b46 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -412,14 +412,43 @@ stdenv.mkDerivation ({ xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 057acf9794e7..1d77a9b4a008 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -394,14 +394,43 @@ stdenv.mkDerivation ({ xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 5d3126ea0e96..c411a546f596 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -395,14 +395,43 @@ stdenv.mkDerivation ({ xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; # If we are making a cross compiler, targetPlatform != hostPlatform NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index bb2c9d8a5c09..ecd0c73d347f 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -395,14 +395,43 @@ stdenv.mkDerivation ({ xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; -- cgit 1.4.1 From cabfe1885f0c4cd9c51828ffef0a358e15d06b00 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 4 Dec 2017 14:34:49 -0500 Subject: gcc: Don't try to enable plugins with host != build --- pkgs/development/compilers/gcc/4.8/default.nix | 2 +- pkgs/development/compilers/gcc/4.9/default.nix | 2 +- pkgs/development/compilers/gcc/5/default.nix | 2 +- pkgs/development/compilers/gcc/6/default.nix | 2 +- pkgs/development/compilers/gcc/7/default.nix | 2 +- pkgs/development/compilers/gcc/snapshot/default.nix | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 1a1400a57a80..9c018ac64673 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -23,7 +23,7 @@ , x11Support ? langJava , gnatboot ? null , enableMultilib ? false -, enablePlugin ? true # whether to support user-supplied plug-ins +, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , name ? "gcc" , libcCross ? null , crossStageStatic ? true diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 8842be6a49ba..c740975f5701 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -23,7 +23,7 @@ , x11Support ? langJava , gnatboot ? null , enableMultilib ? false -, enablePlugin ? true # whether to support user-supplied plug-ins +, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , name ? "gcc" , libcCross ? null , crossStageStatic ? true diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 38bc0dff4b46..8eac7d16e408 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -23,7 +23,7 @@ , x11Support ? langJava , gnatboot ? null , enableMultilib ? false -, enablePlugin ? true # whether to support user-supplied plug-ins +, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , name ? "gcc" , libcCross ? null , crossStageStatic ? true diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 1d77a9b4a008..66a01ede23be 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -23,7 +23,7 @@ , x11Support ? langJava , gnatboot ? null , enableMultilib ? false -, enablePlugin ? true # whether to support user-supplied plug-ins +, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , name ? "gcc" , libcCross ? null , crossStageStatic ? true diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index c411a546f596..6d3cda4401b6 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -23,7 +23,7 @@ , x11Support ? langJava , gnatboot ? null , enableMultilib ? false -, enablePlugin ? true # whether to support user-supplied plug-ins +, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , name ? "gcc" , libcCross ? null , crossStageStatic ? true diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index ecd0c73d347f..848e6215dacd 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -23,7 +23,7 @@ , x11Support ? langJava , gnatboot ? null , enableMultilib ? false -, enablePlugin ? true # whether to support user-supplied plug-ins +, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins , name ? "gcc" , libcCross ? null , crossStageStatic ? true -- cgit 1.4.1 From 74cbb5796eef0469cc704bdcf6d271cc614bfd19 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 4 Dec 2017 12:54:27 -0500 Subject: gcc: Get rid of crossAttrs.configureFlags --- pkgs/development/compilers/gcc/4.5/default.nix | 57 +++++++++----------- pkgs/development/compilers/gcc/4.8/default.nix | 62 ++++------------------ pkgs/development/compilers/gcc/4.9/default.nix | 62 ++++------------------ pkgs/development/compilers/gcc/5/default.nix | 61 ++++----------------- pkgs/development/compilers/gcc/6/default.nix | 61 ++++----------------- pkgs/development/compilers/gcc/7/default.nix | 61 ++++----------------- .../development/compilers/gcc/snapshot/default.nix | 61 ++++----------------- 7 files changed, 86 insertions(+), 339 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 114fc4d8307c..c860991b8cf1 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -63,6 +63,28 @@ let version = "4.5.4"; javaAwtGtk = langJava && gtk2 != null; + /* Platform flags */ + platformFlags = let + gccArch = targetPlatform.gcc.arch or null; + gccCpu = targetPlatform.gcc.cpu or null; + gccAbi = targetPlatform.gcc.abi or null; + gccFpu = targetPlatform.gcc.fpu or null; + gccFloat = targetPlatform.gcc.float or null; + gccMode = targetPlatform.gcc.mode or null; + withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; + withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; + withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; + withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; + withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; + withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; + in + withArch + + withCpu + + withAbi + + withFpu + + withFloat + + withMode; + /* Cross-gcc settings */ gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null targetPlatform; gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null targetPlatformt; @@ -268,7 +290,10 @@ stdenv.mkDerivation ({ ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} - "; + ${if targetPlatform == hostPlatform then platformFlags else ""} + " + optionalString + (hostPlatform != buildPlatform) + (platformFlags + " --target=${targetPlatform.config}"); targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; @@ -314,36 +339,6 @@ stdenv.mkDerivation ({ # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; dontStrip = true; - configureFlags = '' - ${if enableMultilib then "" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""} - ${if cloogppl != null then "--with-cloog=${cloogppl.crossDrv}" else ""} - ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""} - --with-gmp=${gmp.crossDrv} - --with-mpfr=${mpfr.crossDrv} - --with-mpc=${libmpc.crossDrv} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ) - ) - } - ${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} - ''; }; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 9c018ac64673..aa2160f6db2e 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -98,12 +98,12 @@ let version = "4.8.5"; /* Platform flags */ platformFlags = let - gccArch = stdenv.platform.gcc.arch or null; - gccCpu = stdenv.platform.gcc.cpu or null; - gccAbi = stdenv.platform.gcc.abi or null; - gccFpu = stdenv.platform.gcc.fpu or null; - gccFloat = stdenv.platform.gcc.float or null; - gccMode = stdenv.platform.gcc.mode or null; + gccArch = targetPlatform.gcc.arch or null; + gccCpu = targetPlatform.gcc.cpu or null; + gccAbi = targetPlatform.gcc.abi or null; + gccFpu = targetPlatform.gcc.fpu or null; + gccFloat = targetPlatform.gcc.float or null; + gccMode = targetPlatform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; @@ -366,7 +366,9 @@ stdenv.mkDerivation ({ ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} ${if !bootstrap then "--disable-bootstrap" else ""} ${if targetPlatform == hostPlatform then platformFlags else ""} - "; + " + optionalString + (hostPlatform != buildPlatform) + (platformFlags + " --target=${targetPlatform.config}"); targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; @@ -379,18 +381,7 @@ stdenv.mkDerivation ({ then "install-strip" else "install"; - crossAttrs = let - xgccArch = targetPlatform.gcc.arch or null; - xgccCpu = targetPlatform.gcc.cpu or null; - xgccAbi = targetPlatform.gcc.abi or null; - xgccFpu = targetPlatform.gcc.fpu or null; - xgccFloat = targetPlatform.gcc.float or null; - xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; - xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; - xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; - xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; - xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; - in { + crossAttrs = { AR_FOR_BUILD = "ar"; AS_FOR_BUILD = "as"; LD_FOR_BUILD = "ld"; @@ -432,39 +423,6 @@ stdenv.mkDerivation ({ # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; dontStrip = true; - configureFlags = '' - ${if enableMultilib then "" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if cloog != null then "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" else ""} - ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""} - --with-gmp=${gmp.crossDrv} - --with-mpfr=${mpfr.crossDrv} - --with-mpc=${libmpc.crossDrv} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ) - ) - } - ${if langAda then " --enable-libada" else ""} - --target=${targetPlatform.config} - ${xwithArch} - ${xwithCpu} - ${xwithAbi} - ${xwithFpu} - ${xwithFloat} - ''; buildFlags = ""; }; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index c740975f5701..d6e09ca8dac2 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -100,12 +100,12 @@ let version = "4.9.4"; /* Platform flags */ platformFlags = let - gccArch = stdenv.platform.gcc.arch or null; - gccCpu = stdenv.platform.gcc.cpu or null; - gccAbi = stdenv.platform.gcc.abi or null; - gccFpu = stdenv.platform.gcc.fpu or null; - gccFloat = stdenv.platform.gcc.float or null; - gccMode = stdenv.platform.gcc.mode or null; + gccArch = targetPlatform.gcc.arch or null; + gccCpu = targetPlatform.gcc.cpu or null; + gccAbi = targetPlatform.gcc.abi or null; + gccFpu = targetPlatform.gcc.fpu or null; + gccFloat = targetPlatform.gcc.float or null; + gccMode = targetPlatform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; @@ -372,7 +372,9 @@ stdenv.mkDerivation ({ ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} ${if !bootstrap then "--disable-bootstrap" else ""} ${if targetPlatform == hostPlatform then platformFlags else ""} - "; + " + optionalString + (hostPlatform != buildPlatform) + (platformFlags + " --target=${targetPlatform.config}"); targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; @@ -385,18 +387,7 @@ stdenv.mkDerivation ({ then "install-strip" else "install"; - crossAttrs = let - xgccArch = targetPlatform.gcc.arch or null; - xgccCpu = targetPlatform.gcc.cpu or null; - xgccAbi = targetPlatform.gcc.abi or null; - xgccFpu = targetPlatform.gcc.fpu or null; - xgccFloat = targetPlatform.gcc.float or null; - xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; - xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; - xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; - xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; - xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; - in { + crossAttrs = { AR_FOR_BUILD = "ar"; AS_FOR_BUILD = "as"; LD_FOR_BUILD = "ld"; @@ -438,39 +429,6 @@ stdenv.mkDerivation ({ # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; dontStrip = true; - configureFlags = '' - ${if enableMultilib then "" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if cloog != null then "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" else ""} - ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""} - --with-gmp=${gmp.crossDrv} - --with-mpfr=${mpfr.crossDrv} - --with-mpc=${libmpc.crossDrv} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ) - ) - } - ${if langAda then " --enable-libada" else ""} - --target=${targetPlatform.config} - ${xwithArch} - ${xwithCpu} - ${xwithAbi} - ${xwithFpu} - ${xwithFloat} - ''; buildFlags = ""; }; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 8eac7d16e408..f6a6a32ab9a1 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -104,12 +104,12 @@ let version = "5.4.0"; /* Platform flags */ platformFlags = let - gccArch = stdenv.platform.gcc.arch or null; - gccCpu = stdenv.platform.gcc.cpu or null; - gccAbi = stdenv.platform.gcc.abi or null; - gccFpu = stdenv.platform.gcc.fpu or null; - gccFloat = stdenv.platform.gcc.float or null; - gccMode = stdenv.platform.gcc.mode or null; + gccArch = targetPlatform.gcc.arch or null; + gccCpu = targetPlatform.gcc.cpu or null; + gccAbi = targetPlatform.gcc.abi or null; + gccFpu = targetPlatform.gcc.fpu or null; + gccFloat = targetPlatform.gcc.float or null; + gccMode = targetPlatform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; @@ -387,7 +387,9 @@ stdenv.mkDerivation ({ ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} ${if !bootstrap then "--disable-bootstrap" else ""} ${if targetPlatform == hostPlatform then platformFlags else ""} - "; + " + optionalString + (hostPlatform != buildPlatform) + (platformFlags + " --target=${targetPlatform.config}"); targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; @@ -400,18 +402,7 @@ stdenv.mkDerivation ({ then "install-strip" else "install"; - crossAttrs = let - xgccArch = targetPlatform.gcc.arch or null; - xgccCpu = targetPlatform.gcc.cpu or null; - xgccAbi = targetPlatform.gcc.abi or null; - xgccFpu = targetPlatform.gcc.fpu or null; - xgccFloat = targetPlatform.gcc.float or null; - xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; - xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; - xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; - xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; - xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; - in { + crossAttrs = { AR_FOR_BUILD = "ar"; AS_FOR_BUILD = "as"; LD_FOR_BUILD = "ld"; @@ -453,38 +444,6 @@ stdenv.mkDerivation ({ # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; dontStrip = true; - configureFlags = '' - ${if enableMultilib then "" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""} - --with-gmp=${gmp.crossDrv} - --with-mpfr=${mpfr.crossDrv} - --with-mpc=${libmpc.crossDrv} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ) - ) - } - ${if langAda then " --enable-libada" else ""} - --target=${targetPlatform.config} - ${xwithArch} - ${xwithCpu} - ${xwithAbi} - ${xwithFpu} - ${xwithFloat} - ''; buildFlags = ""; }; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 66a01ede23be..474c8b66de6c 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -100,12 +100,12 @@ let version = "6.3.0"; /* Platform flags */ platformFlags = let - gccArch = stdenv.platform.gcc.arch or null; - gccCpu = stdenv.platform.gcc.cpu or null; - gccAbi = stdenv.platform.gcc.abi or null; - gccFpu = stdenv.platform.gcc.fpu or null; - gccFloat = stdenv.platform.gcc.float or null; - gccMode = stdenv.platform.gcc.mode or null; + gccArch = targetPlatform.gcc.arch or null; + gccCpu = targetPlatform.gcc.cpu or null; + gccAbi = targetPlatform.gcc.abi or null; + gccFpu = targetPlatform.gcc.fpu or null; + gccFloat = targetPlatform.gcc.float or null; + gccMode = targetPlatform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; @@ -369,7 +369,9 @@ stdenv.mkDerivation ({ ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} ${if !bootstrap then "--disable-bootstrap" else ""} ${if targetPlatform == hostPlatform then platformFlags else ""} - "; + " + optionalString + (hostPlatform != buildPlatform) + (platformFlags + " --target=${targetPlatform.config}"); targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; @@ -382,18 +384,7 @@ stdenv.mkDerivation ({ then "install-strip" else "install"; - crossAttrs = let - xgccArch = targetPlatform.gcc.arch or null; - xgccCpu = targetPlatform.gcc.cpu or null; - xgccAbi = targetPlatform.gcc.abi or null; - xgccFpu = targetPlatform.gcc.fpu or null; - xgccFloat = targetPlatform.gcc.float or null; - xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; - xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; - xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; - xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; - xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; - in { + crossAttrs = { AR_FOR_BUILD = "ar"; AS_FOR_BUILD = "as"; LD_FOR_BUILD = "ld"; @@ -435,38 +426,6 @@ stdenv.mkDerivation ({ # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; dontStrip = true; - configureFlags = '' - ${if enableMultilib then "" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""} - --with-gmp=${gmp.crossDrv} - --with-mpfr=${mpfr.crossDrv} - --with-mpc=${libmpc.crossDrv} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ) - ) - } - ${if langAda then " --enable-libada" else ""} - --target=${targetPlatform.config} - ${xwithArch} - ${xwithCpu} - ${xwithAbi} - ${xwithFpu} - ${xwithFloat} - ''; buildFlags = ""; }; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 6d3cda4401b6..3955c2c453ea 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -100,12 +100,12 @@ let version = "7.1.0"; /* Platform flags */ platformFlags = let - gccArch = stdenv.platform.gcc.arch or null; - gccCpu = stdenv.platform.gcc.cpu or null; - gccAbi = stdenv.platform.gcc.abi or null; - gccFpu = stdenv.platform.gcc.fpu or null; - gccFloat = stdenv.platform.gcc.float or null; - gccMode = stdenv.platform.gcc.mode or null; + gccArch = targetPlatform.gcc.arch or null; + gccCpu = targetPlatform.gcc.cpu or null; + gccAbi = targetPlatform.gcc.abi or null; + gccFpu = targetPlatform.gcc.fpu or null; + gccFloat = targetPlatform.gcc.float or null; + gccMode = targetPlatform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; @@ -370,7 +370,9 @@ stdenv.mkDerivation ({ ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} ${if !bootstrap then "--disable-bootstrap" else ""} ${if targetPlatform == hostPlatform then platformFlags else ""} - "; + " + optionalString + (hostPlatform != buildPlatform) + (platformFlags + " --target=${targetPlatform.config}"); targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; @@ -383,18 +385,7 @@ stdenv.mkDerivation ({ then "install-strip" else "install"; - crossAttrs = let - xgccArch = targetPlatform.gcc.arch or null; - xgccCpu = targetPlatform.gcc.cpu or null; - xgccAbi = targetPlatform.gcc.abi or null; - xgccFpu = targetPlatform.gcc.fpu or null; - xgccFloat = targetPlatform.gcc.float or null; - xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; - xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; - xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; - xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; - xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; - in { + crossAttrs = { AR_FOR_BUILD = "ar"; AS_FOR_BUILD = "as"; LD_FOR_BUILD = "ld"; @@ -436,38 +427,6 @@ stdenv.mkDerivation ({ # If we are making a cross compiler, targetPlatform != hostPlatform NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; dontStrip = true; - configureFlags = '' - ${if enableMultilib then "" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""} - --with-gmp=${gmp.crossDrv} - --with-mpfr=${mpfr.crossDrv} - --with-mpc=${libmpc.crossDrv} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ) - ) - } - ${if langAda then " --enable-libada" else ""} - --target=${targetPlatform.config} - ${xwithArch} - ${xwithCpu} - ${xwithAbi} - ${xwithFpu} - ${xwithFloat} - ''; buildFlags = ""; }; diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index 848e6215dacd..6cb64d2b9ee4 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -100,12 +100,12 @@ let version = "7-20170409"; /* Platform flags */ platformFlags = let - gccArch = stdenv.platform.gcc.arch or null; - gccCpu = stdenv.platform.gcc.cpu or null; - gccAbi = stdenv.platform.gcc.abi or null; - gccFpu = stdenv.platform.gcc.fpu or null; - gccFloat = stdenv.platform.gcc.float or null; - gccMode = stdenv.platform.gcc.mode or null; + gccArch = targetPlatform.gcc.arch or null; + gccCpu = targetPlatform.gcc.cpu or null; + gccAbi = targetPlatform.gcc.abi or null; + gccFpu = targetPlatform.gcc.fpu or null; + gccFloat = targetPlatform.gcc.float or null; + gccMode = targetPlatform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; @@ -370,7 +370,9 @@ stdenv.mkDerivation ({ ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} ${if !bootstrap then "--disable-bootstrap" else ""} ${if targetPlatform == hostPlatform then platformFlags else ""} - "; + " + optionalString + (hostPlatform != buildPlatform) + (platformFlags + " --target=${targetPlatform.config}"); targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; @@ -383,18 +385,7 @@ stdenv.mkDerivation ({ then "install-strip" else "install"; - crossAttrs = let - xgccArch = targetPlatform.gcc.arch or null; - xgccCpu = targetPlatform.gcc.cpu or null; - xgccAbi = targetPlatform.gcc.abi or null; - xgccFpu = targetPlatform.gcc.fpu or null; - xgccFloat = targetPlatform.gcc.float or null; - xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; - xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; - xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; - xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; - xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; - in { + crossAttrs = { AR_FOR_BUILD = "ar"; AS_FOR_BUILD = "as"; LD_FOR_BUILD = "ld"; @@ -436,38 +427,6 @@ stdenv.mkDerivation ({ # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; dontStrip = true; - configureFlags = '' - ${if enableMultilib then "" else "--disable-multilib"} - ${if enableShared then "" else "--disable-shared"} - ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} - ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} - ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""} - --with-gmp=${gmp.crossDrv} - --with-mpfr=${mpfr.crossDrv} - --with-mpc=${libmpc.crossDrv} - --disable-libstdcxx-pch - --without-included-gettext - --with-system-zlib - --enable-languages=${ - concatStrings (intersperse "," - ( optional langC "c" - ++ optional langCC "c++" - ++ optional langFortran "fortran" - ++ optional langJava "java" - ++ optional langAda "ada" - ++ optional langVhdl "vhdl" - ++ optional langGo "go" - ) - ) - } - ${if langAda then " --enable-libada" else ""} - --target=${targetPlatform.config} - ${xwithArch} - ${xwithCpu} - ${xwithAbi} - ${xwithFpu} - ${xwithFloat} - ''; buildFlags = ""; }; -- cgit 1.4.1 From 1fe9798ac23e9be70553ba20a37fc32aa4f98f7f Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 5 Dec 2017 13:45:43 -0500 Subject: lib, gcc: No `inherit (platform) gcc;` in {host,build,target}Platform --- lib/systems/examples.nix | 9 +------- pkgs/development/compilers/gcc/4.5/default.nix | 12 +++++------ pkgs/development/compilers/gcc/4.8/default.nix | 24 +++++++++++----------- pkgs/development/compilers/gcc/4.9/default.nix | 24 +++++++++++----------- pkgs/development/compilers/gcc/5/default.nix | 24 +++++++++++----------- pkgs/development/compilers/gcc/6/default.nix | 24 +++++++++++----------- pkgs/development/compilers/gcc/7/default.nix | 24 +++++++++++----------- .../development/compilers/gcc/snapshot/default.nix | 24 +++++++++++----------- 8 files changed, 79 insertions(+), 86 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index e394f43831c9..28eb29c977ac 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -18,7 +18,6 @@ rec { libc = "glibc"; platform = platforms.sheevaplug; openssl.system = "linux-generic32"; - inherit (platform) gcc; }; raspberryPi = rec { @@ -31,7 +30,6 @@ rec { libc = "glibc"; platform = platforms.raspberrypi; openssl.system = "linux-generic32"; - inherit (platform) gcc; }; armv7l-hf-multiplatform = rec { @@ -44,7 +42,6 @@ rec { libc = "glibc"; platform = platforms.armv7l-hf-multiplatform; openssl.system = "linux-generic32"; - inherit (platform) gcc; }; aarch64-multiplatform = rec { @@ -54,13 +51,11 @@ rec { withTLS = true; libc = "glibc"; platform = platforms.aarch64-multiplatform; - inherit (platform) gcc; }; scaleway-c1 = armv7l-hf-multiplatform // rec { platform = platforms.scaleway-c1; - inherit (platform) gcc; - inherit (gcc) fpu; + inherit (platform.gcc) fpu; }; pogoplug4 = rec { @@ -70,7 +65,6 @@ rec { platform = platforms.pogoplug4; - inherit (platform) gcc; libc = "glibc"; withTLS = true; @@ -86,7 +80,6 @@ rec { libc = "glibc"; platform = platforms.fuloong2f_n32; openssl.system = "linux-generic32"; - inherit (platform) gcc; }; # diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index c860991b8cf1..ad605fdf268d 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -65,12 +65,12 @@ let version = "4.5.4"; /* Platform flags */ platformFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index aa2160f6db2e..15f8c1858f28 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -98,12 +98,12 @@ let version = "4.8.5"; /* Platform flags */ platformFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; @@ -122,12 +122,12 @@ let version = "4.8.5"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index d6e09ca8dac2..b46510fe3d92 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -100,12 +100,12 @@ let version = "4.9.4"; /* Platform flags */ platformFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; @@ -124,12 +124,12 @@ let version = "4.9.4"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index f6a6a32ab9a1..e78e0b251cbe 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -104,12 +104,12 @@ let version = "5.4.0"; /* Platform flags */ platformFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; @@ -128,12 +128,12 @@ let version = "5.4.0"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 474c8b66de6c..947017343e2f 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -100,12 +100,12 @@ let version = "6.3.0"; /* Platform flags */ platformFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; @@ -124,12 +124,12 @@ let version = "6.3.0"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 3955c2c453ea..7d2c07716953 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -100,12 +100,12 @@ let version = "7.1.0"; /* Platform flags */ platformFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; @@ -124,12 +124,12 @@ let version = "7.1.0"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index 6cb64d2b9ee4..c2ac32486614 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -100,12 +100,12 @@ let version = "7-20170409"; /* Platform flags */ platformFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; @@ -124,12 +124,12 @@ let version = "7-20170409"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossConfigureFlags = let - gccArch = targetPlatform.gcc.arch or null; - gccCpu = targetPlatform.gcc.cpu or null; - gccAbi = targetPlatform.gcc.abi or null; - gccFpu = targetPlatform.gcc.fpu or null; - gccFloat = targetPlatform.gcc.float or null; - gccMode = targetPlatform.gcc.mode or null; + gccArch = targetPlatform.platform.gcc.arch or null; + gccCpu = targetPlatform.platform.gcc.cpu or null; + gccAbi = targetPlatform.platform.gcc.abi or null; + gccFpu = targetPlatform.platform.gcc.fpu or null; + gccFloat = targetPlatform.platform.gcc.float or null; + gccMode = targetPlatform.platform.gcc.mode or null; withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; -- cgit 1.4.1 From a3e35fbbe1fe9a3d117de69fb50f000ef5f4b312 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 5 Dec 2017 14:01:18 -0500 Subject: gcc: Use platformFlags in crossConfigureFlags A nice code deduplication --- pkgs/development/compilers/gcc/4.5/default.nix | 13 +------------ pkgs/development/compilers/gcc/4.8/default.nix | 22 ++-------------------- pkgs/development/compilers/gcc/4.9/default.nix | 22 ++-------------------- pkgs/development/compilers/gcc/5/default.nix | 22 ++-------------------- pkgs/development/compilers/gcc/6/default.nix | 22 ++-------------------- pkgs/development/compilers/gcc/7/default.nix | 22 ++-------------------- .../development/compilers/gcc/snapshot/default.nix | 22 ++-------------------- 7 files changed, 13 insertions(+), 132 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index ad605fdf268d..5e19798c0fa9 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -85,20 +85,9 @@ let version = "4.5.4"; withFloat + withMode; - /* Cross-gcc settings */ - gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null targetPlatform; - gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null targetPlatformt; - gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null targetPlatform; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - crossMingw = (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"); - crossConfigureFlags = "--target=${targetPlatform.config}" + - withArch + - withCpu + - withAbi + + platformFlags + # Ensure that -print-prog-name is able to find the correct programs. " --with-as=${binutils}/bin/${targetPlatform.config}-as" + " --with-ld=${binutils}/bin/${targetPlatform.config}-ld" + diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 15f8c1858f28..69348d50d0ac 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -121,27 +121,9 @@ let version = "4.8.5"; /* Cross-gcc settings */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; - crossConfigureFlags = let - gccArch = targetPlatform.platform.gcc.arch or null; - gccCpu = targetPlatform.platform.gcc.cpu or null; - gccAbi = targetPlatform.platform.gcc.abi or null; - gccFpu = targetPlatform.platform.gcc.fpu or null; - gccFloat = targetPlatform.platform.gcc.float or null; - gccMode = targetPlatform.platform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in + crossConfigureFlags = "--target=${targetPlatform.config}" + - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode + + platformFlags + # Ensure that -print-prog-name is able to find the correct programs. " --with-as=${binutils}/bin/${targetPlatform.config}-as" + " --with-ld=${binutils}/bin/${targetPlatform.config}-ld" + diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index b46510fe3d92..5b5bd44322ef 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -123,27 +123,9 @@ let version = "4.9.4"; /* Cross-gcc settings */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; - crossConfigureFlags = let - gccArch = targetPlatform.platform.gcc.arch or null; - gccCpu = targetPlatform.platform.gcc.cpu or null; - gccAbi = targetPlatform.platform.gcc.abi or null; - gccFpu = targetPlatform.platform.gcc.fpu or null; - gccFloat = targetPlatform.platform.gcc.float or null; - gccMode = targetPlatform.platform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in + crossConfigureFlags = "--target=${targetPlatform.config}" + - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode + + platformFlags + # Ensure that -print-prog-name is able to find the correct programs. " --with-as=${binutils}/bin/${targetPlatform.config}-as" + " --with-ld=${binutils}/bin/${targetPlatform.config}-ld" + diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index e78e0b251cbe..c9605416f4e2 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -127,27 +127,9 @@ let version = "5.4.0"; /* Cross-gcc settings */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; - crossConfigureFlags = let - gccArch = targetPlatform.platform.gcc.arch or null; - gccCpu = targetPlatform.platform.gcc.cpu or null; - gccAbi = targetPlatform.platform.gcc.abi or null; - gccFpu = targetPlatform.platform.gcc.fpu or null; - gccFloat = targetPlatform.platform.gcc.float or null; - gccMode = targetPlatform.platform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in + crossConfigureFlags = "--target=${targetPlatform.config}" + - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode + + platformFlags + # Ensure that -print-prog-name is able to find the correct programs. " --with-as=${binutils}/bin/${targetPlatform.config}-as" + " --with-ld=${binutils}/bin/${targetPlatform.config}-ld" + diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 947017343e2f..fe308b771678 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -123,27 +123,9 @@ let version = "6.3.0"; /* Cross-gcc settings */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; - crossConfigureFlags = let - gccArch = targetPlatform.platform.gcc.arch or null; - gccCpu = targetPlatform.platform.gcc.cpu or null; - gccAbi = targetPlatform.platform.gcc.abi or null; - gccFpu = targetPlatform.platform.gcc.fpu or null; - gccFloat = targetPlatform.platform.gcc.float or null; - gccMode = targetPlatform.platform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in + crossConfigureFlags = "--target=${targetPlatform.config}" + - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode + + platformFlags + # Ensure that -print-prog-name is able to find the correct programs. " --with-as=${binutils}/bin/${targetPlatform.config}-as" + " --with-ld=${binutils}/bin/${targetPlatform.config}-ld" + diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 7d2c07716953..3ca6e470c2fd 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -123,27 +123,9 @@ let version = "7.1.0"; /* Cross-gcc settings */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; - crossConfigureFlags = let - gccArch = targetPlatform.platform.gcc.arch or null; - gccCpu = targetPlatform.platform.gcc.cpu or null; - gccAbi = targetPlatform.platform.gcc.abi or null; - gccFpu = targetPlatform.platform.gcc.fpu or null; - gccFloat = targetPlatform.platform.gcc.float or null; - gccMode = targetPlatform.platform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in + crossConfigureFlags = "--target=${targetPlatform.config}" + - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode + + platformFlags + # Ensure that -print-prog-name is able to find the correct programs. " --with-as=${binutils}/bin/${targetPlatform.config}-as" + " --with-ld=${binutils}/bin/${targetPlatform.config}-ld" + diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index c2ac32486614..ec7e234607e9 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -123,27 +123,9 @@ let version = "7-20170409"; /* Cross-gcc settings */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; - crossConfigureFlags = let - gccArch = targetPlatform.platform.gcc.arch or null; - gccCpu = targetPlatform.platform.gcc.cpu or null; - gccAbi = targetPlatform.platform.gcc.abi or null; - gccFpu = targetPlatform.platform.gcc.fpu or null; - gccFloat = targetPlatform.platform.gcc.float or null; - gccMode = targetPlatform.platform.gcc.mode or null; - withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; - withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; - withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; - withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else ""; - withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; - withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; - in + crossConfigureFlags = "--target=${targetPlatform.config}" + - withArch + - withCpu + - withAbi + - withFpu + - withFloat + - withMode + + platformFlags + # Ensure that -print-prog-name is able to find the correct programs. " --with-as=${binutils}/bin/${targetPlatform.config}-as" + " --with-ld=${binutils}/bin/${targetPlatform.config}-ld" + -- cgit 1.4.1 From d4595b38e90790a2b8ee01a7127889747ba05bb7 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 1 Dec 2017 16:21:54 -0500 Subject: gcc: Modernize builder.sh for Cross Instead of `NIX_CC` vs `NIX_CC_CROSS` spagetti, unconditionally use `NIX_BUILD_CC` and `NIX_CC` in a consistent manner. --- pkgs/development/compilers/gcc/4.5/default.nix | 9 +- pkgs/development/compilers/gcc/4.8/default.nix | 12 +- pkgs/development/compilers/gcc/4.9/default.nix | 12 +- pkgs/development/compilers/gcc/5/default.nix | 12 +- pkgs/development/compilers/gcc/6/default.nix | 12 +- pkgs/development/compilers/gcc/7/default.nix | 12 +- pkgs/development/compilers/gcc/builder.sh | 197 +++++++++++---------- .../development/compilers/gcc/snapshot/default.nix | 12 +- 8 files changed, 135 insertions(+), 143 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 5e19798c0fa9..68c83a208da8 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -274,6 +274,8 @@ stdenv.mkDerivation ({ ) ) } + ${optionalString (!(crossMingw && crossStageStatic)) + "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} ${ # Trick that should be taken out once we have a mips64el-linux not loongson2f if targetPlatform == hostPlatform && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""} ${if langAda then " --enable-libada" else ""} @@ -325,11 +327,12 @@ stdenv.mkDerivation ({ STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - # If we are making a cross compiler, cross != null - NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; + dontStrip = true; }; - + + NIX_BUILD_CC = stdenv.cc; + NIX_CC_CROSS = stdenv.ccCross or null; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 69348d50d0ac..17965406da05 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -338,11 +338,8 @@ stdenv.mkDerivation ({ ) ) } - ${if targetPlatform == hostPlatform - then if hostPlatform.isDarwin - then " --with-native-system-header-dir=${darwin.usr-include}" - else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include" - else ""} + ${optionalString (!(crossMingw && crossStageStatic)) + "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -402,12 +399,13 @@ stdenv.mkDerivation ({ STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - # If we are making a cross compiler, cross != null - NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; + dontStrip = true; buildFlags = ""; }; + NIX_BUILD_CC = stdenv.cc; + NIX_CC_CROSS = stdenv.ccCross or null; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 5b5bd44322ef..e41fc798efc7 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -344,11 +344,8 @@ stdenv.mkDerivation ({ ) ) } - ${if targetPlatform == hostPlatform - then if hostPlatform.isDarwin - then " --with-native-system-header-dir=${darwin.usr-include}" - else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include" - else ""} + ${optionalString (!(crossMingw && crossStageStatic)) + "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -408,12 +405,13 @@ stdenv.mkDerivation ({ STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - # If we are making a cross compiler, cross != null - NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; + dontStrip = true; buildFlags = ""; }; + NIX_BUILD_CC = stdenv.cc; + NIX_CC_CROSS = stdenv.ccCross or null; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index c9605416f4e2..afdf8c2c9285 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -359,11 +359,8 @@ stdenv.mkDerivation ({ ) ) } - ${if targetPlatform == hostPlatform - then if hostPlatform.isDarwin - then " --with-native-system-header-dir=${darwin.usr-include}" - else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include" - else ""} + ${optionalString (!(crossMingw && crossStageStatic)) + "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -423,12 +420,13 @@ stdenv.mkDerivation ({ STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - # If we are making a cross compiler, cross != null - NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; + dontStrip = true; buildFlags = ""; }; + NIX_BUILD_CC = stdenv.cc; + NIX_CC_CROSS = stdenv.ccCross or null; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index fe308b771678..848d4cf6e6f9 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -341,11 +341,8 @@ stdenv.mkDerivation ({ ) ) } - ${if targetPlatform == hostPlatform - then if hostPlatform.isDarwin - then " --with-native-system-header-dir=${darwin.usr-include}" - else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include" - else ""} + ${optionalString (!(crossMingw && crossStageStatic)) + "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -405,12 +402,13 @@ stdenv.mkDerivation ({ STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - # If we are making a cross compiler, cross != null - NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; + dontStrip = true; buildFlags = ""; }; + NIX_BUILD_CC = stdenv.cc; + NIX_CC_CROSS = stdenv.ccCross or null; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 3ca6e470c2fd..96d2d5f2efc9 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -342,11 +342,8 @@ stdenv.mkDerivation ({ ) ) } - ${if targetPlatform == hostPlatform - then if hostPlatform.isDarwin - then " --with-native-system-header-dir=${darwin.usr-include}" - else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include" - else ""} + ${optionalString (!(crossMingw && crossStageStatic)) + "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -406,12 +403,13 @@ stdenv.mkDerivation ({ STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - # If we are making a cross compiler, targetPlatform != hostPlatform - NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; + dontStrip = true; buildFlags = ""; }; + NIX_BUILD_CC = stdenv.cc; + NIX_CC_CROSS = stdenv.ccCross or null; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index ee56425f00b4..12097f8ff953 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -1,8 +1,17 @@ source $stdenv/setup -export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy -mkdir $NIX_FIXINC_DUMMY +oldOpts="$(shopt -po nounset)" || true +set -euo pipefail + + +if test -n "${NIX_CC_CROSS-}"; then + export NIX_CC="$NIX_CC_CROSS" +fi + + +export NIX_FIXINC_DUMMY="$NIX_BUILD_TOP/dummy" +mkdir "$NIX_FIXINC_DUMMY" if test "$staticCompiler" = "1"; then @@ -20,134 +29,126 @@ echo "\$LIBRARY_PATH is \`$LIBRARY_PATH'" if test "$noSysDirs" = "1"; then - if test -e $NIX_CC/nix-support/orig-libc; then - - # Figure out what extra flags to pass to the gcc compilers - # being generated to make sure that they use our glibc. - extraFlags="$(cat $NIX_CC/nix-support/libc-cflags)" - extraLDFlags="$(cat $NIX_CC/nix-support/libc-ldflags) $(cat $NIX_CC/nix-support/libc-ldflags-before || true)" + declare \ + EXTRA_BUILD_FLAGS EXTRA_FLAGS EXTRA_TARGET_FLAGS \ + EXTRA_BUILD_LDFLAGS EXTRA_TARGET_LDFLAGS - # Use *real* header files, otherwise a limits.h is generated - # that does not include Glibc's limits.h (notably missing - # SSIZE_MAX, which breaks the build). - export NIX_FIXINC_DUMMY=$libc_dev/include + for pre in 'BUILD_' ''; do + curCC="NIX_${pre}CC" + curFIXINC="NIX_${pre}FIXINC_DUMMY" - # The path to the Glibc binaries such as `crti.o'. - glibc_libdir="$(cat $NIX_CC/nix-support/orig-libc)/lib" + declare -a extraFlags=() extraLDFlags=() + if [[ -e "${!curCC}/nix-support/orig-libc" ]]; then + # Figure out what extra flags to pass to the gcc compilers being + # generated to make sure that they use our glibc. + extraFlags=($(cat "${!curCC}/nix-support/libc-cflags")) + extraLDFlags=($(cat "${!curCC}/nix-support/libc-ldflags") $(cat "${!curCC}/nix-support/libc-ldflags-before" || true)) - else - # Hack: support impure environments. - extraFlags="-isystem /usr/include" - extraLDFlags="-L/usr/lib64 -L/usr/lib" - glibc_libdir="/usr/lib" - export NIX_FIXINC_DUMMY=/usr/include - fi + # The path to the Glibc binaries such as `crti.o'. + glibc_libdir="$(cat "${!curCC}/nix-support/orig-libc")/lib" + glibc_devdir="$(cat "${!curCC}/nix-support/orig-libc-dev")" - extraFlags="-I$NIX_FIXINC_DUMMY $extraFlags" - extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags" + # Use *real* header files, otherwise a limits.h is generated that + # does not include Glibc's limits.h (notably missing SSIZE_MAX, + # which breaks the build). + declare NIX_${pre}FIXINC_DUMMY="$glibc_devdir/include" + else + # Hack: support impure environments. + extraFlags=("-isystem" "/usr/include") + extraLDFlags=("-L/usr/lib64" "-L/usr/lib") + glibc_libdir="/usr/lib" + declare NIX_${pre}FIXINC_DUMMY=/usr/include + fi - # BOOT_CFLAGS defaults to `-g -O2'; since we override it below, - # make sure to explictly add them so that files compiled with the - # bootstrap compiler are optimized and (optionally) contain - # debugging information (info "(gccinstall) Building"). - if test -n "$dontStrip"; then - extraFlags="-O2 -g $extraFlags" - else - # Don't pass `-g' at all; this saves space while building. - extraFlags="-O2 $extraFlags" - fi + extraFlags=("-I${!curFIXINC}" + "${extraFlags[@]}") + extraLDFlags=("-L$glibc_libdir" "-rpath" "$glibc_libdir" + "${extraLDFlags[@]}") + + # BOOT_CFLAGS defaults to `-g -O2'; since we override it below, make + # sure to explictly add them so that files compiled with the bootstrap + # compiler are optimized and (optionally) contain debugging information + # (info "(gccinstall) Building"). + if test -n "${dontStrip-}"; then + extraFlags=("-O2" "-g" "${extraFlags[@]}") + else + # Don't pass `-g' at all; this saves space while building. + extraFlags=("-O2" "${extraFlags[@]}") + fi - EXTRA_FLAGS="$extraFlags" - for i in $extraLDFlags; do - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,$i" + declare EXTRA_${pre}FLAGS="${extraFlags[*]}" + for i in "${extraLDFlags[@]}"; do + declare EXTRA_${pre}LDFLAGS+=" -Wl,$i" + done done - if test -n "$targetConfig"; then - # Cross-compiling, we need gcc not to read ./specs in order to build - # the g++ compiler (after the specs for the cross-gcc are created). - # Having LIBRARY_PATH= makes gcc read the specs from ., and the build + if test -n "${targetConfig-}"; then + # Cross-compiling, we need gcc not to read ./specs in order to build the + # g++ compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build # breaks. Having this variable comes from the default.nix code to bring # gcj in. unset LIBRARY_PATH unset CPATH else - if test -z "$NIX_CC_CROSS"; then - EXTRA_TARGET_CFLAGS="$EXTRA_FLAGS" - EXTRA_TARGET_CXXFLAGS="$EXTRA_FLAGS" - EXTRA_TARGET_LDFLAGS="$EXTRA_LDFLAGS" - else - # This the case of cross-building the gcc. - # We need special flags for the target, different than those of the build - # Assertion: - test -e $NIX_CC_CROSS/nix-support/orig-libc - - # Figure out what extra flags to pass to the gcc compilers - # being generated to make sure that they use our glibc. - extraFlags="$(cat $NIX_CC_CROSS/nix-support/libc-cflags)" - extraLDFlags="$(cat $NIX_CC_CROSS/nix-support/libc-ldflags) $(cat $NIX_CC_CROSS/nix-support/libc-ldflags-before)" - - # The path to the Glibc binaries such as `crti.o'. - glibc_dir="$(cat $NIX_CC_CROSS/nix-support/orig-libc)" - glibc_libdir="$glibc_dir/lib" - glibc_devdir="$(cat $NIX_CC_CROSS/nix-support/orig-libc-dev)" - configureFlags="$configureFlags --with-native-system-header-dir=$glibc_devdir/include" - - # Use *real* header files, otherwise a limits.h is generated - # that does not include Glibc's limits.h (notably missing - # SSIZE_MAX, which breaks the build). - NIX_FIXINC_DUMMY_CROSS="$glibc_devdir/include" - - extraFlags="-I$NIX_FIXINC_DUMMY_CROSS $extraFlags" - extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags" - - EXTRA_TARGET_CFLAGS="$extraFlags" - for i in $extraLDFlags; do - EXTRA_TARGET_LDFLAGS="$EXTRA_TARGET_LDFLAGS -Wl,$i" - done - fi + # host = target, so the flags are the same + EXTRA_TARGET_FLAGS="$EXTRA_FLAGS" + EXTRA_TARGET_LDFLAGS="$EXTRA_LDFLAGS" fi # CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find # the startfiles. # FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx # for the startfiles. - makeFlagsArray+=( \ - NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ - SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ - CFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \ - CXXFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \ - CFLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \ - CXXFLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \ - FLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \ - LDFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \ - LDFLAGS_FOR_TARGET="$EXTRA_TARGET_LDFLAGS $EXTRA_TARGET_LDFLAGS" \ + makeFlagsArray+=( + "BUILD_SYSTEM_HEADER_DIR=$NIX_BUILD_FIXINC_DUMMY" + "SYSTEM_HEADER_DIR=$NIX_BUILD_FIXINC_DUMMY" + "NATIVE_SYSTEM_HEADER_DIR=$NIX_FIXINC_DUMMY" + + "LDFLAGS_FOR_BUILD=$EXTRA_BUILD_LDFLAGS" + #"LDFLAGS=$EXTRA_LDFLAGS" + "LDFLAGS_FOR_TARGET=$EXTRA_TARGET_LDFLAGS" + + "CFLAGS_FOR_BUILD=$EXTRA_BUILD_FLAGS $EXTRA_BUILD_LDFLAGS" + "CXXFLAGS_FOR_BUILD=$EXTRA_BUILD_FLAGS $EXTRA_BUILD_LDFLAGS" + "FLAGS_FOR_BUILD=$EXTRA_BUILD_FLAGS $EXTRA_BUILD_LDFLAGS" + + # It seems there is a bug in GCC 5 + #"CFLAGS=$EXTRA_FLAGS $EXTRA_LDFLAGS" + #"CXXFLAGS=$EXTRA_FLAGS $EXTRA_LDFLAGS" + + "CFLAGS_FOR_TARGET=$EXTRA_TARGET_FLAGS $EXTRA_TARGET_LDFLAGS" + "CXXFLAGS_FOR_TARGET=$EXTRA_TARGET_FLAGS $EXTRA_TARGET_LDFLAGS" + "FLAGS_FOR_TARGET=$EXTRA_TARGET_FLAGS $EXTRA_TARGET_LDFLAGS" + ) + + if test -z "${targetConfig-}"; then + makeFlagsArray+=( + "BOOT_CFLAGS=$EXTRA_FLAGS $EXTRA_LDFLAGS" + "BOOT_LDFLAGS=$EXTRA_TARGET_FLAGS $EXTRA_TARGET_LDFLAGS" ) - - if test -z "$targetConfig"; then - makeFlagsArray+=( \ - BOOT_CFLAGS="$EXTRA_FLAGS $EXTRA_LDFLAGS" \ - BOOT_LDFLAGS="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \ - ) fi - if test -n "$targetConfig" -a "$crossStageStatic" == 1; then + if test -n "${targetConfig-}" -a "$crossStageStatic" == 1; then # We don't want the gcc build to assume there will be a libc providing # limits.h in this stagae - makeFlagsArray+=( \ - LIMITS_H_TEST=false \ - ) + makeFlagsArray+=( + 'LIMITS_H_TEST=false' + ) else - makeFlagsArray+=( \ - LIMITS_H_TEST=true \ - ) + makeFlagsArray+=( + 'LIMITS_H_TEST=true' + ) fi fi -if test -n "$targetConfig"; then +if test -n "${targetConfig-}"; then # The host strip will destroy some important details of the objects dontStrip=1 fi +eval "$oldOpts" + providedPreConfigure="$preConfigure"; preConfigure() { if test -n "$newlibSrc"; then diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index ec7e234607e9..8212c1c85baf 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -342,11 +342,8 @@ stdenv.mkDerivation ({ ) ) } - ${if targetPlatform == hostPlatform - then if hostPlatform.isDarwin - then " --with-native-system-header-dir=${darwin.usr-include}" - else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include" - else ""} + ${optionalString (!(crossMingw && crossStageStatic)) + "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -406,12 +403,13 @@ stdenv.mkDerivation ({ STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - # If we are making a cross compiler, cross != null - NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; + dontStrip = true; buildFlags = ""; }; + NIX_BUILD_CC = stdenv.cc; + NIX_CC_CROSS = stdenv.ccCross or null; # Needed for the cross compilation to work AR = "ar"; -- cgit 1.4.1 From d96cf0f46c2df4c83f6c518bca9869b789b07172 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 2 Dec 2017 12:26:49 -0500 Subject: gcc: Handle `CPATH` and `LIBRARY_PATH` purely in Nix --- pkgs/development/compilers/gcc/4.5/default.nix | 71 +++++++++++----------- pkgs/development/compilers/gcc/4.8/default.nix | 68 +++++++++++---------- pkgs/development/compilers/gcc/4.9/default.nix | 68 +++++++++++---------- pkgs/development/compilers/gcc/5/default.nix | 68 +++++++++++---------- pkgs/development/compilers/gcc/6/default.nix | 70 ++++++++++----------- pkgs/development/compilers/gcc/7/default.nix | 70 ++++++++++----------- pkgs/development/compilers/gcc/builder.sh | 18 ++---- .../development/compilers/gcc/snapshot/default.nix | 70 ++++++++++----------- 8 files changed, 254 insertions(+), 249 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 68c83a208da8..c4dae5c8b66f 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -339,18 +339,21 @@ stdenv.mkDerivation ({ LD = "ld"; CC = "gcc"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find - # the library headers and binaries, regarless of the language being - # compiled. - - # Note: When building the Java AWT GTK+ peer, the build system doesn't - # honor `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just - # add them to $CPATH and $LIBRARY_PATH in this case. + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK+ peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. # # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = makeSearchPathOutput "dev" "include" ([] + CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs @@ -360,41 +363,39 @@ stdenv.mkDerivation ({ # On GNU/Hurd glibc refers to Mach & Hurd # headers. - ++ optionals (libcCross != null && - hasAttr "propagatedBuildInputs" libcCross) - libcCross.propagatedBuildInputs); + ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" ) + libcCross.propagatedBuildInputs + )); - LIBRARY_PATH = makeLibraryPath ([] + LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ++ optional (libpthread != null) libpthread); - - EXTRA_TARGET_CFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-idirafter ${libcCross.dev}/include" - ] - ++ optionals (! crossStageStatic) [ - "-B${libcCross.out}/lib" - ] - else null; - - EXTRA_TARGET_LDFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-Wl,-L${libcCross.out}/lib" - ] - ++ (if crossStageStatic then [ + ++ optional (libpthread != null) libpthread) + ); + + EXTRA_TARGET_FLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-idirafter ${libcCross.dev}/include" + ] ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ]); + + EXTRA_TARGET_LDFLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-Wl,-L${libcCross.out}/lib" + ] ++ (if crossStageStatic then [ "-B${libcCross.out}/lib" ] else [ "-Wl,-rpath,${libcCross.out}/lib" "-Wl,-rpath-link,${libcCross.out}/lib" - ]) - ++ optionals (libpthreadCross != null) [ - "-L${libpthreadCross}/lib" - "-Wl,${libpthreadCross.TARGET_LDFLAGS}" - ] - else null; + ]) ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ]); passthru = { inherit langC langCC langAda langFortran langVhdl enableMultilib version; isGNU = true; }; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 17965406da05..15529bd554a4 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -413,18 +413,21 @@ stdenv.mkDerivation ({ # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find - # the library headers and binaries, regarless of the language being - # compiled. - - # Note: When building the Java AWT GTK+ peer, the build system doesn't - # honor `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just - # add them to $CPATH and $LIBRARY_PATH in this case. + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK+ peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. # # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = makeSearchPathOutput "dev" "include" ([] + CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs @@ -435,39 +438,38 @@ stdenv.mkDerivation ({ # On GNU/Hurd glibc refers to Mach & Hurd # headers. ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" ) - libcCross.propagatedBuildInputs); + libcCross.propagatedBuildInputs + )); - LIBRARY_PATH = makeLibraryPath ([] + LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ++ optional (libpthread != null) libpthread); - - EXTRA_TARGET_CFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-idirafter ${libcCross.dev}/include" - ] - ++ optionals (! crossStageStatic) [ - "-B${libcCross.out}/lib" - ] - else null; - - EXTRA_TARGET_LDFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-Wl,-L${libcCross.out}/lib" - ] - ++ (if crossStageStatic then [ + ++ optional (libpthread != null) libpthread) + ); + + EXTRA_TARGET_FLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-idirafter ${libcCross.dev}/include" + ] ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ]); + + EXTRA_TARGET_LDFLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-Wl,-L${libcCross.out}/lib" + ] ++ (if crossStageStatic then [ "-B${libcCross.out}/lib" ] else [ "-Wl,-rpath,${libcCross.out}/lib" "-Wl,-rpath-link,${libcCross.out}/lib" - ]) - ++ optionals (libpthreadCross != null) [ - "-L${libpthreadCross}/lib" - "-Wl,${libpthreadCross.TARGET_LDFLAGS}" - ] - else null; + ]) ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ]); passthru = { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index e41fc798efc7..6ece3abd9356 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -419,18 +419,21 @@ stdenv.mkDerivation ({ # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find - # the library headers and binaries, regarless of the language being - # compiled. - - # Note: When building the Java AWT GTK+ peer, the build system doesn't - # honor `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just - # add them to $CPATH and $LIBRARY_PATH in this case. + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK+ peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. # # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = makeSearchPathOutput "dev" "include" ([] + CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs @@ -441,39 +444,38 @@ stdenv.mkDerivation ({ # On GNU/Hurd glibc refers to Mach & Hurd # headers. ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" ) - libcCross.propagatedBuildInputs); + libcCross.propagatedBuildInputs + )); - LIBRARY_PATH = makeLibraryPath ([] + LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ++ optional (libpthread != null) libpthread); - - EXTRA_TARGET_CFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-idirafter ${libcCross.dev}/include" - ] - ++ optionals (! crossStageStatic) [ - "-B${libcCross.out}/lib" - ] - else null; - - EXTRA_TARGET_LDFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-Wl,-L${libcCross.out}/lib" - ] - ++ (if crossStageStatic then [ + ++ optional (libpthread != null) libpthread) + ); + + EXTRA_TARGET_FLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-idirafter ${libcCross.dev}/include" + ] ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ]); + + EXTRA_TARGET_LDFLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-Wl,-L${libcCross.out}/lib" + ] ++ (if crossStageStatic then [ "-B${libcCross.out}/lib" ] else [ "-Wl,-rpath,${libcCross.out}/lib" "-Wl,-rpath-link,${libcCross.out}/lib" - ]) - ++ optionals (libpthreadCross != null) [ - "-L${libpthreadCross}/lib" - "-Wl,${libpthreadCross.TARGET_LDFLAGS}" - ] - else null; + ]) ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ]); passthru = { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index afdf8c2c9285..f6242573e67f 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -434,18 +434,21 @@ stdenv.mkDerivation ({ # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find - # the library headers and binaries, regarless of the language being - # compiled. - - # Note: When building the Java AWT GTK+ peer, the build system doesn't - # honor `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just - # add them to $CPATH and $LIBRARY_PATH in this case. + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK+ peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. # # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = makeSearchPathOutput "dev" "include" ([] + CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optionals langJava [ boehmgc ] ++ optionals javaAwtGtk xlibs @@ -456,39 +459,38 @@ stdenv.mkDerivation ({ # On GNU/Hurd glibc refers to Mach & Hurd # headers. ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" ) - libcCross.propagatedBuildInputs); + libcCross.propagatedBuildInputs + )); - LIBRARY_PATH = makeLibraryPath ([] + LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ++ optional (libpthread != null) libpthread); - - EXTRA_TARGET_CFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-idirafter ${getDev libcCross}/include" - ] - ++ optionals (! crossStageStatic) [ - "-B${libcCross.out}/lib" - ] - else null; - - EXTRA_TARGET_LDFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-Wl,-L${libcCross.out}/lib" - ] - ++ (if crossStageStatic then [ + ++ optional (libpthread != null) libpthread) + ); + + EXTRA_TARGET_FLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-idirafter ${getDev libcCross}/include" + ] ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ]); + + EXTRA_TARGET_LDFLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-Wl,-L${libcCross.out}/lib" + ] ++ (if crossStageStatic then [ "-B${libcCross.out}/lib" ] else [ "-Wl,-rpath,${libcCross.out}/lib" "-Wl,-rpath-link,${libcCross.out}/lib" - ]) - ++ optionals (libpthreadCross != null) [ - "-L${libpthreadCross}/lib" - "-Wl,${libpthreadCross.TARGET_LDFLAGS}" - ] - else null; + ]) ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ]); passthru = { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 848d4cf6e6f9..324fb3e0c1ac 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -416,18 +416,21 @@ stdenv.mkDerivation ({ # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find - # the library headers and binaries, regarless of the language being - # compiled. - - # Note: When building the Java AWT GTK+ peer, the build system doesn't - # honor `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just - # add them to $CPATH and $LIBRARY_PATH in this case. + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK+ peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. # # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = makeSearchPathOutput "dev" "include" ([] + CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs @@ -437,40 +440,39 @@ stdenv.mkDerivation ({ # On GNU/Hurd glibc refers to Mach & Hurd # headers. - ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs") - libcCross.propagatedBuildInputs); + ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" ) + libcCross.propagatedBuildInputs + )); - LIBRARY_PATH = makeLibraryPath ([] + LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ++ optional (libpthread != null) libpthread); - - EXTRA_TARGET_CFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-idirafter ${getDev libcCross}/include" - ] - ++ optionals (! crossStageStatic) [ - "-B${libcCross.out}/lib" - ] - else null; - - EXTRA_TARGET_LDFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-Wl,-L${libcCross.out}/lib" - ] - ++ (if crossStageStatic then [ + ++ optional (libpthread != null) libpthread) + ); + + EXTRA_TARGET_FLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-idirafter ${getDev libcCross}/include" + ] ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ]); + + EXTRA_TARGET_LDFLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-Wl,-L${libcCross.out}/lib" + ] ++ (if crossStageStatic then [ "-B${libcCross.out}/lib" ] else [ "-Wl,-rpath,${libcCross.out}/lib" "-Wl,-rpath-link,${libcCross.out}/lib" - ]) - ++ optionals (libpthreadCross != null) [ - "-L${libpthreadCross}/lib" - "-Wl,${libpthreadCross.TARGET_LDFLAGS}" - ] - else null; + ]) ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ]); passthru = { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 96d2d5f2efc9..c8d54308c955 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -417,18 +417,21 @@ stdenv.mkDerivation ({ # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find - # the library headers and binaries, regarless of the language being - # compiled. - - # Note: When building the Java AWT GTK+ peer, the build system doesn't - # honor `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just - # add them to $CPATH and $LIBRARY_PATH in this case. + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK+ peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. # # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = makeSearchPathOutput "dev" "include" ([] + CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs @@ -438,40 +441,39 @@ stdenv.mkDerivation ({ # On GNU/Hurd glibc refers to Mach & Hurd # headers. - ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs") - libcCross.propagatedBuildInputs); + ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" ) + libcCross.propagatedBuildInputs + )); - LIBRARY_PATH = makeLibraryPath ([] + LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ++ optional (libpthread != null) libpthread); - - EXTRA_TARGET_CFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-idirafter ${getDev libcCross}/include" - ] - ++ optionals (! crossStageStatic) [ - "-B${libcCross.out}/lib" - ] - else null; - - EXTRA_TARGET_LDFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-Wl,-L${libcCross.out}/lib" - ] - ++ (if crossStageStatic then [ + ++ optional (libpthread != null) libpthread) + ); + + EXTRA_TARGET_FLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-idirafter ${getDev libcCross}/include" + ] ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ]); + + EXTRA_TARGET_LDFLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-Wl,-L${libcCross.out}/lib" + ] ++ (if crossStageStatic then [ "-B${libcCross.out}/lib" ] else [ "-Wl,-rpath,${libcCross.out}/lib" "-Wl,-rpath-link,${libcCross.out}/lib" - ]) - ++ optionals (libpthreadCross != null) [ - "-L${libpthreadCross}/lib" - "-Wl,${libpthreadCross.TARGET_LDFLAGS}" - ] - else null; + ]) ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ]); passthru = { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index 12097f8ff953..3bc1cb49eec7 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -22,10 +22,10 @@ fi # GCC interprets empty paths as ".", which we don't want. -if test -z "$CPATH"; then unset CPATH; fi -if test -z "$LIBRARY_PATH"; then unset LIBRARY_PATH; fi -echo "\$CPATH is \`$CPATH'" -echo "\$LIBRARY_PATH is \`$LIBRARY_PATH'" +if test -z "${CPATH-}"; then unset CPATH; fi +if test -z "${LIBRARY_PATH-}"; then unset LIBRARY_PATH; fi +echo "\$CPATH is \`${CPATH-}'" +echo "\$LIBRARY_PATH is \`${LIBRARY_PATH-}'" if test "$noSysDirs" = "1"; then @@ -82,15 +82,7 @@ if test "$noSysDirs" = "1"; then done done - if test -n "${targetConfig-}"; then - # Cross-compiling, we need gcc not to read ./specs in order to build the - # g++ compiler (after the specs for the cross-gcc are created). Having - # LIBRARY_PATH= makes gcc read the specs from ., and the build - # breaks. Having this variable comes from the default.nix code to bring - # gcj in. - unset LIBRARY_PATH - unset CPATH - else + if test -z "${targetConfig-}"; then # host = target, so the flags are the same EXTRA_TARGET_FLAGS="$EXTRA_FLAGS" EXTRA_TARGET_LDFLAGS="$EXTRA_LDFLAGS" diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index 8212c1c85baf..fd34f414f961 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -417,18 +417,21 @@ stdenv.mkDerivation ({ # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find - # the library headers and binaries, regarless of the language being - # compiled. - - # Note: When building the Java AWT GTK+ peer, the build system doesn't - # honor `--with-gmp' et al., e.g., when building - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just - # add them to $CPATH and $LIBRARY_PATH in this case. + # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the + # library headers and binaries, regarless of the language being compiled. + # + # Note: When building the Java AWT GTK+ peer, the build system doesn't honor + # `--with-gmp' et al., e.g., when building + # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add + # them to $CPATH and $LIBRARY_PATH in this case. # # Likewise, the LTO code doesn't find zlib. + # + # Cross-compiling, we need gcc not to read ./specs in order to build the g++ + # compiler (after the specs for the cross-gcc are created). Having + # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. - CPATH = makeSearchPathOutput "dev" "include" ([] + CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs @@ -438,40 +441,39 @@ stdenv.mkDerivation ({ # On GNU/Hurd glibc refers to Mach & Hurd # headers. - ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs") - libcCross.propagatedBuildInputs); + ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" ) + libcCross.propagatedBuildInputs + )); - LIBRARY_PATH = makeLibraryPath ([] + LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] ++ optional (zlib != null) zlib ++ optional langJava boehmgc ++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ] - ++ optional (libpthread != null) libpthread); - - EXTRA_TARGET_CFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-idirafter ${getDev libcCross}/include" - ] - ++ optionals (! crossStageStatic) [ - "-B${libcCross.out}/lib" - ] - else null; - - EXTRA_TARGET_LDFLAGS = - if targetPlatform != hostPlatform && libcCross != null then [ - "-Wl,-L${libcCross.out}/lib" - ] - ++ (if crossStageStatic then [ + ++ optional (libpthread != null) libpthread) + ); + + EXTRA_TARGET_FLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-idirafter ${getDev libcCross}/include" + ] ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ]); + + EXTRA_TARGET_LDFLAGS = optionals + (targetPlatform != hostPlatform && libcCross != null) + ([ + "-Wl,-L${libcCross.out}/lib" + ] ++ (if crossStageStatic then [ "-B${libcCross.out}/lib" ] else [ "-Wl,-rpath,${libcCross.out}/lib" "-Wl,-rpath-link,${libcCross.out}/lib" - ]) - ++ optionals (libpthreadCross != null) [ - "-L${libpthreadCross}/lib" - "-Wl,${libpthreadCross.TARGET_LDFLAGS}" - ] - else null; + ]) ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ]); passthru = { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; -- cgit 1.4.1 From 51948eab9415fde1825dea5c7d31b99b2e1a0fdb Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 1 Dec 2017 17:13:58 -0500 Subject: gcc: Fix after merge - NIX_CC_CROSS is now completely gone! - NIX_CC is defined reliably, so no manual def needed - stdenv.ccCross -> stdenv.cc, also removing need for "or" fallback --- pkgs/development/compilers/gcc/4.5/default.nix | 6 +++--- pkgs/development/compilers/gcc/4.8/default.nix | 6 +++--- pkgs/development/compilers/gcc/4.9/default.nix | 6 +++--- pkgs/development/compilers/gcc/5/default.nix | 6 ++---- pkgs/development/compilers/gcc/6/default.nix | 6 +++--- pkgs/development/compilers/gcc/7/default.nix | 6 +++--- pkgs/development/compilers/gcc/builder.sh | 5 ----- pkgs/development/compilers/gcc/snapshot/default.nix | 6 +++--- 8 files changed, 20 insertions(+), 27 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index c4dae5c8b66f..b84a44648881 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -25,6 +25,7 @@ , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd , stripped ? true , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -275,7 +276,7 @@ stdenv.mkDerivation ({ ) } ${optionalString (!(crossMingw && crossStageStatic)) - "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include"} ${ # Trick that should be taken out once we have a mips64el-linux not loongson2f if targetPlatform == hostPlatform && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""} ${if langAda then " --enable-libada" else ""} @@ -331,8 +332,7 @@ stdenv.mkDerivation ({ dontStrip = true; }; - NIX_BUILD_CC = stdenv.cc; - NIX_CC_CROSS = stdenv.ccCross or null; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 15529bd554a4..86c4198be23b 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -33,6 +33,7 @@ , gnused ? null , darwin ? null , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -339,7 +340,7 @@ stdenv.mkDerivation ({ ) } ${optionalString (!(crossMingw && crossStageStatic)) - "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -404,8 +405,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; - NIX_BUILD_CC = stdenv.cc; - NIX_CC_CROSS = stdenv.ccCross or null; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 6ece3abd9356..2aa3f340df74 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -33,6 +33,7 @@ , gnused ? null , darwin ? null , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -345,7 +346,7 @@ stdenv.mkDerivation ({ ) } ${optionalString (!(crossMingw && crossStageStatic)) - "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -410,8 +411,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; - NIX_BUILD_CC = stdenv.cc; - NIX_CC_CROSS = stdenv.ccCross or null; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 5d08f785da37..146b1acbb9f2 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -295,7 +295,6 @@ stdenv.mkDerivation ({ ++ (optionals langJava [ boehmgc zip unzip ]) ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) ++ (optionals (targetPlatform != hostPlatform) [binutils]) - ++ (optionals (buildPlatform != hostPlatform) [buildPackages.stdenv.cc]) ++ (optionals langAda [gnatboot]) ++ (optionals langVhdl [gnat]) @@ -362,7 +361,7 @@ stdenv.mkDerivation ({ ) } ${optionalString (!(crossMingw && crossStageStatic)) - "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -431,8 +430,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; - NIX_BUILD_CC = stdenv.cc; - NIX_CC_CROSS = stdenv.ccCross or null; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 324fb3e0c1ac..581ee32af3e9 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -35,6 +35,7 @@ , cloog # unused; just for compat with gcc4, as we override the parameter on some places , darwin ? null , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -342,7 +343,7 @@ stdenv.mkDerivation ({ ) } ${optionalString (!(crossMingw && crossStageStatic)) - "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -407,8 +408,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; - NIX_BUILD_CC = stdenv.cc; - NIX_CC_CROSS = stdenv.ccCross or null; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index c8d54308c955..d70214e41143 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -36,6 +36,7 @@ , darwin ? null , flex ? null , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -343,7 +344,7 @@ stdenv.mkDerivation ({ ) } ${optionalString (!(crossMingw && crossStageStatic)) - "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -408,8 +409,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; - NIX_BUILD_CC = stdenv.cc; - NIX_CC_CROSS = stdenv.ccCross or null; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index 3bc1cb49eec7..d21755d7b1dc 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -5,11 +5,6 @@ oldOpts="$(shopt -po nounset)" || true set -euo pipefail -if test -n "${NIX_CC_CROSS-}"; then - export NIX_CC="$NIX_CC_CROSS" -fi - - export NIX_FIXINC_DUMMY="$NIX_BUILD_TOP/dummy" mkdir "$NIX_FIXINC_DUMMY" diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index fd34f414f961..78891e2c987c 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -36,6 +36,7 @@ , darwin ? null , flex ? null , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -343,7 +344,7 @@ stdenv.mkDerivation ({ ) } ${optionalString (!(crossMingw && crossStageStatic)) - "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -408,8 +409,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; - NIX_BUILD_CC = stdenv.cc; - NIX_CC_CROSS = stdenv.ccCross or null; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; -- cgit 1.4.1 From 12e0672d8848852677c6c77a63e2c793ad7a266b Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 9 Dec 2017 14:19:02 -0500 Subject: gcc: Adjust builder.sh to find some things in bintools-wrapper instead --- pkgs/development/compilers/gcc/4.5/default.nix | 1 + pkgs/development/compilers/gcc/4.8/default.nix | 1 + pkgs/development/compilers/gcc/4.9/default.nix | 1 + pkgs/development/compilers/gcc/5/default.nix | 1 + pkgs/development/compilers/gcc/6/default.nix | 1 + pkgs/development/compilers/gcc/7/default.nix | 1 + pkgs/development/compilers/gcc/builder.sh | 53 ++++++++++++++-------- .../development/compilers/gcc/snapshot/default.nix | 1 + 8 files changed, 41 insertions(+), 19 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index b41d22f4f539..b4ae867d5859 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -356,6 +356,7 @@ stdenv.mkDerivation ({ dontStrip = true; }; + NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools; NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 8713c174d5a6..4efac1b26c34 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -444,6 +444,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; + NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools; NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index c338f9c641ee..fb4218a0edea 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -442,6 +442,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; + NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools; NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 552e827ec366..b4399ef72f19 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -451,6 +451,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; + NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools; NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index fbc490026067..d923092168ab 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -452,6 +452,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; + NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools; NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 032a20271ee0..c9daf813e6f8 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -446,6 +446,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; + NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools; NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index 0765daee4534..1796c83385e5 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -28,37 +28,55 @@ if test "$noSysDirs" = "1"; then EXTRA_BUILD_FLAGS EXTRA_FLAGS EXTRA_TARGET_FLAGS \ EXTRA_BUILD_LDFLAGS EXTRA_TARGET_LDFLAGS + # Extract flags from Bintools Wrappers + for pre in 'BUILD_' ''; do + curBintools="NIX_${pre}BINTOOLS" + + declare -a extraLDFlags=() + if [[ -e "${!curBintools}/nix-support/orig-libc" ]]; then + # Figure out what extra flags when linking to pass to the gcc + # compilers being generated to make sure that they use our libc. + extraLDFlags=($(< "${!curBintools}/nix-support/libc-ldflags") $(< "${!curBintools}/nix-support/libc-ldflags-before" || true)) + + # The path to the Libc binaries such as `crti.o'. + libc_libdir="$(< "${!curBintools}/nix-support/orig-libc")/lib" + else + # Hack: support impure environments. + extraLDFlags=("-L/usr/lib64" "-L/usr/lib") + libc_libdir="/usr/lib" + fi + extraLDFlags=("-L$libc_libdir" "-rpath" "$libc_libdir" + "${extraLDFlags[@]}") + for i in "${extraLDFlags[@]}"; do + declare EXTRA_${pre}LDFLAGS+=" -Wl,$i" + done + done + + # Extract flags from CC Wrappers for pre in 'BUILD_' ''; do curCC="NIX_${pre}CC" curFIXINC="NIX_${pre}FIXINC_DUMMY" - declare -a extraFlags=() extraLDFlags=() + declare -a extraFlags=() if [[ -e "${!curCC}/nix-support/orig-libc" ]]; then - # Figure out what extra flags to pass to the gcc compilers being - # generated to make sure that they use our glibc. - extraFlags=($(cat "${!curCC}/nix-support/libc-cflags")) - extraLDFlags=($(cat "${!curCC}/nix-support/libc-ldflags") $(cat "${!curCC}/nix-support/libc-ldflags-before" || true)) + # Figure out what extra compiling flags to pass to the gcc compilers + # being generated to make sure that they use our libc. + extraFlags=($(< "${!curCC}/nix-support/libc-cflags")) - # The path to the Glibc binaries such as `crti.o'. - glibc_libdir="$(cat "${!curCC}/nix-support/orig-libc")/lib" - glibc_devdir="$(cat "${!curCC}/nix-support/orig-libc-dev")" + # The path to the Libc headers + libc_devdir="$(< "${!curCC}/nix-support/orig-libc-dev")" # Use *real* header files, otherwise a limits.h is generated that - # does not include Glibc's limits.h (notably missing SSIZE_MAX, + # does not include Libc's limits.h (notably missing SSIZE_MAX, # which breaks the build). - declare NIX_${pre}FIXINC_DUMMY="$glibc_devdir/include" + declare NIX_${pre}FIXINC_DUMMY="$libc_devdir/include" else # Hack: support impure environments. extraFlags=("-isystem" "/usr/include") - extraLDFlags=("-L/usr/lib64" "-L/usr/lib") - glibc_libdir="/usr/lib" declare NIX_${pre}FIXINC_DUMMY=/usr/include fi - extraFlags=("-I${!curFIXINC}" - "${extraFlags[@]}") - extraLDFlags=("-L$glibc_libdir" "-rpath" "$glibc_libdir" - "${extraLDFlags[@]}") + extraFlags=("-I${!curFIXINC}" "${extraFlags[@]}") # BOOT_CFLAGS defaults to `-g -O2'; since we override it below, make # sure to explictly add them so that files compiled with the bootstrap @@ -72,9 +90,6 @@ if test "$noSysDirs" = "1"; then fi declare EXTRA_${pre}FLAGS="${extraFlags[*]}" - for i in "${extraLDFlags[@]}"; do - declare EXTRA_${pre}LDFLAGS+=" -Wl,$i" - done done if test -z "${targetConfig-}"; then diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index f2f8eeb09a5e..9d1bdc08133d 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -433,6 +433,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; + NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools; NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work -- cgit 1.4.1 From 771bae04e8ebcef3f11a0be55c28a571181aa231 Mon Sep 17 00:00:00 2001 From: Bojan Nikolic Date: Fri, 29 Dec 2017 14:29:05 +0000 Subject: gcc: Enable SSP and shared libs in the final stage for MinGW Hardening on by default now that we don't use the cross wrapper. In turn, hardening requires libssp in particular. --- pkgs/development/compilers/gcc/4.5/default.nix | 2 +- pkgs/development/compilers/gcc/4.8/default.nix | 6 +----- pkgs/development/compilers/gcc/4.9/default.nix | 6 +----- pkgs/development/compilers/gcc/5/default.nix | 6 +----- pkgs/development/compilers/gcc/6/default.nix | 6 +----- pkgs/development/compilers/gcc/7/default.nix | 6 +----- pkgs/development/compilers/gcc/snapshot/default.nix | 6 +----- 7 files changed, 7 insertions(+), 31 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index c4dae5c8b66f..e7cf6b1f1f1d 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -120,7 +120,7 @@ let version = "4.5.4"; " --enable-sjlj-exceptions" + " --enable-hash-synchronization" + " --enable-version-specific-runtime-libs" + - " --disable-libssp" + + " --enable-libssp" + " --disable-nls" + " --with-dwarf2" else diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 15529bd554a4..f7674bb11845 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -159,13 +159,9 @@ let version = "4.8.5"; " --enable-threads=win32" + " --enable-sjlj-exceptions" + " --enable-hash-synchronization" + - " --disable-libssp" + + " --enable-libssp" + " --disable-nls" + " --with-dwarf2" + - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - " --disable-shared" + # To keep ABI compatibility with upstream mingw-w64 " --enable-fully-dynamic-string" else (if targetPlatform.libc == "uclibc" then diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 6ece3abd9356..05b5ea3a725c 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -159,13 +159,9 @@ let version = "4.9.4"; " --enable-threads=win32" + " --enable-sjlj-exceptions" + " --enable-hash-synchronization" + - " --disable-libssp" + + " --enable-libssp" + " --disable-nls" + " --with-dwarf2" + - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - " --disable-shared" + # To keep ABI compatibility with upstream mingw-w64 " --enable-fully-dynamic-string" else (if targetPlatform.libc == "uclibc" then diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index f6242573e67f..10701f687dec 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -163,13 +163,9 @@ let version = "5.4.0"; " --enable-threads=win32" + " --enable-sjlj-exceptions" + " --enable-hash-synchronization" + - " --disable-libssp" + + " --enable-libssp" + " --disable-nls" + " --with-dwarf2" + - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - " --disable-shared" + # To keep ABI compatibility with upstream mingw-w64 " --enable-fully-dynamic-string" else (if targetPlatform.libc == "uclibc" then diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 324fb3e0c1ac..bcee4026c395 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -159,13 +159,9 @@ let version = "6.3.0"; " --enable-threads=win32" + " --enable-sjlj-exceptions" + " --enable-hash-synchronization" + - " --disable-libssp" + + " --enable-libssp" + " --disable-nls" + " --with-dwarf2" + - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - " --disable-shared" + # To keep ABI compatibility with upstream mingw-w64 " --enable-fully-dynamic-string" else (if targetPlatform.libc == "uclibc" then diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index c8d54308c955..ab56adf1a524 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -160,13 +160,9 @@ let version = "7.1.0"; " --enable-threads=win32" + " --enable-sjlj-exceptions" + " --enable-hash-synchronization" + - " --disable-libssp" + + " --enable-libssp" + " --disable-nls" + " --with-dwarf2" + - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - " --disable-shared" + # To keep ABI compatibility with upstream mingw-w64 " --enable-fully-dynamic-string" else (if targetPlatform.libc == "uclibc" then diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index fd34f414f961..09d4f8af869b 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -160,13 +160,9 @@ let version = "7-20170409"; " --enable-threads=win32" + " --enable-sjlj-exceptions" + " --enable-hash-synchronization" + - " --disable-libssp" + + " --enable-libssp" + " --disable-nls" + " --with-dwarf2" + - # I think noone uses shared gcc libs in mingw, so we better do the same. - # In any case, mingw32 g++ linking is broken by default with shared libs, - # unless adding "-lsupc++" to any linking command. I don't know why. - " --disable-shared" + # To keep ABI compatibility with upstream mingw-w64 " --enable-fully-dynamic-string" else (if targetPlatform.libc == "uclibc" then -- cgit 1.4.1 From bc23afe5c7fd9095b1e49fccc51a42a18dd220c4 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 17 Aug 2017 02:05:56 -0400 Subject: gcc: Add build->build dep for C compilers 5 already had this, but I forgot the other versions. --- pkgs/development/compilers/gcc/4.5/default.nix | 1 + pkgs/development/compilers/gcc/4.8/default.nix | 1 + pkgs/development/compilers/gcc/4.9/default.nix | 1 + pkgs/development/compilers/gcc/6/default.nix | 1 + pkgs/development/compilers/gcc/7/default.nix | 1 + pkgs/development/compilers/gcc/snapshot/default.nix | 1 + 6 files changed, 6 insertions(+) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 36fde924e9b9..9f8a3bd6fb6f 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -229,6 +229,7 @@ stdenv.mkDerivation ({ inherit noSysDirs profiledCompiler staticCompiler langJava libcCross crossMingw; + depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ texinfo which gettext ] ++ optional (perl != null) perl; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index e626abc50d14..65f95846f02b 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -267,6 +267,7 @@ stdenv.mkDerivation ({ inherit noSysDirs staticCompiler langJava libcCross crossMingw; + depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ texinfo which gettext ] ++ (optional (perl != null) perl) ++ (optional javaAwtGtk pkgconfig); diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 621c45cdff38..5cc6dbffd151 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -262,6 +262,7 @@ stdenv.mkDerivation ({ inherit noSysDirs staticCompiler langJava libcCross crossMingw; + depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ texinfo which gettext ] ++ (optional (perl != null) perl) ++ (optional javaAwtGtk pkgconfig); diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 33a034adf667..d9e1a71ae3af 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -276,6 +276,7 @@ stdenv.mkDerivation ({ inherit noSysDirs staticCompiler langJava libcCross crossMingw; + depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ texinfo which gettext ] ++ (optional (perl != null) perl) ++ (optional javaAwtGtk pkgconfig); diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 291ec944b554..76a636bb2dc8 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -273,6 +273,7 @@ stdenv.mkDerivation ({ inherit noSysDirs staticCompiler langJava libcCross crossMingw; + depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ texinfo which gettext ] ++ (optional (perl != null) perl) ++ (optional javaAwtGtk pkgconfig); diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index e8668712e2ea..4857eb5e517c 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -260,6 +260,7 @@ stdenv.mkDerivation ({ inherit noSysDirs staticCompiler langJava libcCross crossMingw; + depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ texinfo which gettext ] ++ (optional (perl != null) perl) ++ (optional javaAwtGtk pkgconfig); -- cgit 1.4.1 From 114a9b625386e3ca4e142dce6ce8bcfcabea8fe3 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 18 Aug 2017 13:58:48 -0400 Subject: gcc: Let cc-wrapper's setup hook define any tool env vars we need --- pkgs/development/compilers/gcc/4.5/default.nix | 47 ---------------------- pkgs/development/compilers/gcc/4.8/default.nix | 47 +--------------------- pkgs/development/compilers/gcc/4.9/default.nix | 47 +--------------------- pkgs/development/compilers/gcc/5/default.nix | 47 +--------------------- pkgs/development/compilers/gcc/6/default.nix | 47 +--------------------- pkgs/development/compilers/gcc/7/default.nix | 47 +--------------------- .../development/compilers/gcc/snapshot/default.nix | 47 +--------------------- 7 files changed, 6 insertions(+), 323 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 9f8a3bd6fb6f..23dcacd837dc 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -315,56 +315,9 @@ stdenv.mkDerivation ({ /* For cross-built gcc (build != host == target) */ crossAttrs = { - AR_FOR_BUILD = "ar"; - AS_FOR_BUILD = "as"; - LD_FOR_BUILD = "ld"; - NM_FOR_BUILD = "nm"; - OBJCOPY_FOR_BUILD = "objcopy"; - OBJDUMP_FOR_BUILD = "objdump"; - RANLIB_FOR_BUILD = "ranlib"; - SIZE_FOR_BUILD = "size"; - STRINGS_FOR_BUILD = "strings"; - STRIP_FOR_BUILD = "strip"; - CC_FOR_BUILD = "gcc"; - CXX_FOR_BUILD = "g++"; - - AR = "${targetPlatform.config}-ar"; - AS = "${targetPlatform.config}-as"; - LD = "${targetPlatform.config}-ld"; - NM = "${targetPlatform.config}-nm"; - OBJCOPY = "${targetPlatform.config}-objcopy"; - OBJDUMP = "${targetPlatform.config}-objdump"; - RANLIB = "${targetPlatform.config}-ranlib"; - SIZE = "${targetPlatform.config}-size"; - STRINGS = "${targetPlatform.config}-strings"; - STRIP = "${targetPlatform.config}-strip"; - CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-g++"; - - AR_FOR_TARGET = "${targetPlatform.config}-ar"; - AS_FOR_TARGET = "${targetPlatform.config}-as"; - LD_FOR_TARGET = "${targetPlatform.config}-ld"; - NM_FOR_TARGET = "${targetPlatform.config}-nm"; - OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; - OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; - RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; - SIZE_FOR_TARGET = "${targetPlatform.config}-size"; - STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; - STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; - CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - dontStrip = true; }; - NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools; - NIX_BUILD_CC = buildPackages.stdenv.cc; - - # Needed for the cross compilation to work - AR = "ar"; - LD = "ld"; - CC = "gcc"; - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the # library headers and binaries, regarless of the language being compiled. # diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 65f95846f02b..c828b7776adc 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -398,57 +398,12 @@ stdenv.mkDerivation ({ /* For cross-built gcc (build != host == target) */ crossAttrs = { - AR_FOR_BUILD = "ar"; - AS_FOR_BUILD = "as"; - LD_FOR_BUILD = "ld"; - NM_FOR_BUILD = "nm"; - OBJCOPY_FOR_BUILD = "objcopy"; - OBJDUMP_FOR_BUILD = "objdump"; - RANLIB_FOR_BUILD = "ranlib"; - SIZE_FOR_BUILD = "size"; - STRINGS_FOR_BUILD = "strings"; - STRIP_FOR_BUILD = "strip"; - CC_FOR_BUILD = "gcc"; - CXX_FOR_BUILD = "g++"; - - AR = "${targetPlatform.config}-ar"; - AS = "${targetPlatform.config}-as"; - LD = "${targetPlatform.config}-ld"; - NM = "${targetPlatform.config}-nm"; - OBJCOPY = "${targetPlatform.config}-objcopy"; - OBJDUMP = "${targetPlatform.config}-objdump"; - RANLIB = "${targetPlatform.config}-ranlib"; - SIZE = "${targetPlatform.config}-size"; - STRINGS = "${targetPlatform.config}-strings"; - STRIP = "${targetPlatform.config}-strip"; - CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-g++"; - - AR_FOR_TARGET = "${targetPlatform.config}-ar"; - AS_FOR_TARGET = "${targetPlatform.config}-as"; - LD_FOR_TARGET = "${targetPlatform.config}-ld"; - NM_FOR_TARGET = "${targetPlatform.config}-nm"; - OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; - OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; - RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; - SIZE_FOR_TARGET = "${targetPlatform.config}-size"; - STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; - STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; - CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - dontStrip = true; buildFlags = ""; }; - NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools; - NIX_BUILD_CC = buildPackages.stdenv.cc; - - # Needed for the cross compilation to work - AR = "ar"; - LD = "ld"; # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; + CC = if hostPlatform.system == "x86_64-solaris" then "gcc -m64" else "gcc"; # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the # library headers and binaries, regarless of the language being compiled. diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 5cc6dbffd151..7aa5610b5395 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -396,57 +396,12 @@ stdenv.mkDerivation ({ /* For cross-built gcc (build != host == target) */ crossAttrs = { - AR_FOR_BUILD = "ar"; - AS_FOR_BUILD = "as"; - LD_FOR_BUILD = "ld"; - NM_FOR_BUILD = "nm"; - OBJCOPY_FOR_BUILD = "objcopy"; - OBJDUMP_FOR_BUILD = "objdump"; - RANLIB_FOR_BUILD = "ranlib"; - SIZE_FOR_BUILD = "size"; - STRINGS_FOR_BUILD = "strings"; - STRIP_FOR_BUILD = "strip"; - CC_FOR_BUILD = "gcc"; - CXX_FOR_BUILD = "g++"; - - AR = "${targetPlatform.config}-ar"; - AS = "${targetPlatform.config}-as"; - LD = "${targetPlatform.config}-ld"; - NM = "${targetPlatform.config}-nm"; - OBJCOPY = "${targetPlatform.config}-objcopy"; - OBJDUMP = "${targetPlatform.config}-objdump"; - RANLIB = "${targetPlatform.config}-ranlib"; - SIZE = "${targetPlatform.config}-size"; - STRINGS = "${targetPlatform.config}-strings"; - STRIP = "${targetPlatform.config}-strip"; - CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-g++"; - - AR_FOR_TARGET = "${targetPlatform.config}-ar"; - AS_FOR_TARGET = "${targetPlatform.config}-as"; - LD_FOR_TARGET = "${targetPlatform.config}-ld"; - NM_FOR_TARGET = "${targetPlatform.config}-nm"; - OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; - OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; - RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; - SIZE_FOR_TARGET = "${targetPlatform.config}-size"; - STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; - STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; - CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - dontStrip = true; buildFlags = ""; }; - NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools; - NIX_BUILD_CC = buildPackages.stdenv.cc; - - # Needed for the cross compilation to work - AR = "ar"; - LD = "ld"; # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; + CC = if hostPlatform.system == "x86_64-solaris" then "gcc -m64" else "gcc"; # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the # library headers and binaries, regarless of the language being compiled. diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index f109d20f5736..3a7ad0a4c590 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -404,57 +404,12 @@ stdenv.mkDerivation ({ /* For cross-built gcc (build != host == target) */ crossAttrs = { - AR_FOR_BUILD = "ar"; - AS_FOR_BUILD = "as"; - LD_FOR_BUILD = "ld"; - NM_FOR_BUILD = "nm"; - OBJCOPY_FOR_BUILD = "objcopy"; - OBJDUMP_FOR_BUILD = "objdump"; - RANLIB_FOR_BUILD = "ranlib"; - SIZE_FOR_BUILD = "size"; - STRINGS_FOR_BUILD = "strings"; - STRIP_FOR_BUILD = "strip"; - CC_FOR_BUILD = "gcc"; - CXX_FOR_BUILD = "g++"; - - AR = "${targetPlatform.config}-ar"; - AS = "${targetPlatform.config}-as"; - LD = "${targetPlatform.config}-ld"; - NM = "${targetPlatform.config}-nm"; - OBJCOPY = "${targetPlatform.config}-objcopy"; - OBJDUMP = "${targetPlatform.config}-objdump"; - RANLIB = "${targetPlatform.config}-ranlib"; - SIZE = "${targetPlatform.config}-size"; - STRINGS = "${targetPlatform.config}-strings"; - STRIP = "${targetPlatform.config}-strip"; - CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-g++"; - - AR_FOR_TARGET = "${targetPlatform.config}-ar"; - AS_FOR_TARGET = "${targetPlatform.config}-as"; - LD_FOR_TARGET = "${targetPlatform.config}-ld"; - NM_FOR_TARGET = "${targetPlatform.config}-nm"; - OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; - OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; - RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; - SIZE_FOR_TARGET = "${targetPlatform.config}-size"; - STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; - STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; - CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - dontStrip = true; buildFlags = ""; }; - NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools; - NIX_BUILD_CC = buildPackages.stdenv.cc; - - # Needed for the cross compilation to work - AR = "ar"; - LD = "ld"; # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; + CC = if hostPlatform.system == "x86_64-solaris" then "gcc -m64" else "gcc"; # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the # library headers and binaries, regarless of the language being compiled. diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index d9e1a71ae3af..894abdb43fbc 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -406,57 +406,12 @@ stdenv.mkDerivation ({ /* For cross-built gcc (build != host == target) */ crossAttrs = { - AR_FOR_BUILD = "ar"; - AS_FOR_BUILD = "as"; - LD_FOR_BUILD = "ld"; - NM_FOR_BUILD = "nm"; - OBJCOPY_FOR_BUILD = "objcopy"; - OBJDUMP_FOR_BUILD = "objdump"; - RANLIB_FOR_BUILD = "ranlib"; - SIZE_FOR_BUILD = "size"; - STRINGS_FOR_BUILD = "strings"; - STRIP_FOR_BUILD = "strip"; - CC_FOR_BUILD = "gcc"; - CXX_FOR_BUILD = "g++"; - - AR = "${targetPlatform.config}-ar"; - AS = "${targetPlatform.config}-as"; - LD = "${targetPlatform.config}-ld"; - NM = "${targetPlatform.config}-nm"; - OBJCOPY = "${targetPlatform.config}-objcopy"; - OBJDUMP = "${targetPlatform.config}-objdump"; - RANLIB = "${targetPlatform.config}-ranlib"; - SIZE = "${targetPlatform.config}-size"; - STRINGS = "${targetPlatform.config}-strings"; - STRIP = "${targetPlatform.config}-strip"; - CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-g++"; - - AR_FOR_TARGET = "${targetPlatform.config}-ar"; - AS_FOR_TARGET = "${targetPlatform.config}-as"; - LD_FOR_TARGET = "${targetPlatform.config}-ld"; - NM_FOR_TARGET = "${targetPlatform.config}-nm"; - OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; - OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; - RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; - SIZE_FOR_TARGET = "${targetPlatform.config}-size"; - STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; - STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; - CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - dontStrip = true; buildFlags = ""; }; - NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools; - NIX_BUILD_CC = buildPackages.stdenv.cc; - - # Needed for the cross compilation to work - AR = "ar"; - LD = "ld"; # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; + CC = if hostPlatform.system == "x86_64-solaris" then "gcc -m64" else "gcc"; # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the # library headers and binaries, regarless of the language being compiled. diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 76a636bb2dc8..09e111f37fb7 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -400,57 +400,12 @@ stdenv.mkDerivation ({ /* For cross-built gcc (build != host == target) */ crossAttrs = { - AR_FOR_BUILD = "ar"; - AS_FOR_BUILD = "as"; - LD_FOR_BUILD = "ld"; - NM_FOR_BUILD = "nm"; - OBJCOPY_FOR_BUILD = "objcopy"; - OBJDUMP_FOR_BUILD = "objdump"; - RANLIB_FOR_BUILD = "ranlib"; - SIZE_FOR_BUILD = "size"; - STRINGS_FOR_BUILD = "strings"; - STRIP_FOR_BUILD = "strip"; - CC_FOR_BUILD = "gcc"; - CXX_FOR_BUILD = "g++"; - - AR = "${targetPlatform.config}-ar"; - AS = "${targetPlatform.config}-as"; - LD = "${targetPlatform.config}-ld"; - NM = "${targetPlatform.config}-nm"; - OBJCOPY = "${targetPlatform.config}-objcopy"; - OBJDUMP = "${targetPlatform.config}-objdump"; - RANLIB = "${targetPlatform.config}-ranlib"; - SIZE = "${targetPlatform.config}-size"; - STRINGS = "${targetPlatform.config}-strings"; - STRIP = "${targetPlatform.config}-strip"; - CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-g++"; - - AR_FOR_TARGET = "${targetPlatform.config}-ar"; - AS_FOR_TARGET = "${targetPlatform.config}-as"; - LD_FOR_TARGET = "${targetPlatform.config}-ld"; - NM_FOR_TARGET = "${targetPlatform.config}-nm"; - OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; - OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; - RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; - SIZE_FOR_TARGET = "${targetPlatform.config}-size"; - STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; - STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; - CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - dontStrip = true; buildFlags = ""; }; - NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools; - NIX_BUILD_CC = buildPackages.stdenv.cc; - - # Needed for the cross compilation to work - AR = "ar"; - LD = "ld"; # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; + CC = if hostPlatform.system == "x86_64-solaris" then "gcc -m64" else "gcc"; # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the # library headers and binaries, regarless of the language being compiled. diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index 4857eb5e517c..955347809775 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -387,57 +387,12 @@ stdenv.mkDerivation ({ /* For cross-built gcc (build != host == target) */ crossAttrs = { - AR_FOR_BUILD = "ar"; - AS_FOR_BUILD = "as"; - LD_FOR_BUILD = "ld"; - NM_FOR_BUILD = "nm"; - OBJCOPY_FOR_BUILD = "objcopy"; - OBJDUMP_FOR_BUILD = "objdump"; - RANLIB_FOR_BUILD = "ranlib"; - SIZE_FOR_BUILD = "size"; - STRINGS_FOR_BUILD = "strings"; - STRIP_FOR_BUILD = "strip"; - CC_FOR_BUILD = "gcc"; - CXX_FOR_BUILD = "g++"; - - AR = "${targetPlatform.config}-ar"; - AS = "${targetPlatform.config}-as"; - LD = "${targetPlatform.config}-ld"; - NM = "${targetPlatform.config}-nm"; - OBJCOPY = "${targetPlatform.config}-objcopy"; - OBJDUMP = "${targetPlatform.config}-objdump"; - RANLIB = "${targetPlatform.config}-ranlib"; - SIZE = "${targetPlatform.config}-size"; - STRINGS = "${targetPlatform.config}-strings"; - STRIP = "${targetPlatform.config}-strip"; - CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-g++"; - - AR_FOR_TARGET = "${targetPlatform.config}-ar"; - AS_FOR_TARGET = "${targetPlatform.config}-as"; - LD_FOR_TARGET = "${targetPlatform.config}-ld"; - NM_FOR_TARGET = "${targetPlatform.config}-nm"; - OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; - OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; - RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; - SIZE_FOR_TARGET = "${targetPlatform.config}-size"; - STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; - STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; - CXX_FOR_TARGET = "${targetPlatform.config}-g++"; - dontStrip = true; buildFlags = ""; }; - NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools; - NIX_BUILD_CC = buildPackages.stdenv.cc; - - # Needed for the cross compilation to work - AR = "ar"; - LD = "ld"; # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc"; + CC = if hostPlatform.system == "x86_64-solaris" then "gcc -m64" else "gcc"; # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the # library headers and binaries, regarless of the language being compiled. -- cgit 1.4.1 From 9cda2f5559bcbc8ca279521561f6096b35c7f07a Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 4 Sep 2017 15:48:52 -0400 Subject: gcc: Fix deps, for cross and consistency Mainly making sure we have tools to build target libs --- pkgs/development/compilers/gcc/4.5/default.nix | 14 ++++++++++++-- pkgs/development/compilers/gcc/4.9/default.nix | 14 ++++++++++++-- pkgs/development/compilers/gcc/5/default.nix | 17 ++++++++++++----- pkgs/development/compilers/gcc/6/default.nix | 17 ++++++++++++----- pkgs/development/compilers/gcc/7/default.nix | 17 ++++++++++++----- pkgs/development/compilers/gcc/snapshot/default.nix | 17 ++++++++++++----- 6 files changed, 72 insertions(+), 24 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 23dcacd837dc..0d02d46d91bf 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -233,8 +233,18 @@ stdenv.mkDerivation ({ nativeBuildInputs = [ texinfo which gettext ] ++ optional (perl != null) perl; - buildInputs = [ gmp mpfr libmpc libelf ] - ++ (optional (ppl != null) ppl) + # For building runtime libs + depsBuildTarget = + if hostPlatform == buildPlatform then [ + targetPackages.stdenv.cc.bintools # newly-built gcc will be used + ] else assert targetPlatform == hostPlatform; [ # build != host == target + stdenv.cc + ]; + + buildInputs = [ + gmp mpfr libmpc libelf + targetPackages.stdenv.cc.bintools # For linking code at run-time + ] ++ (optional (ppl != null) ppl) ++ (optional (cloogppl != null) cloogppl) ++ (optional (zlib != null) zlib) ++ (optional langJava boehmgc) diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 7aa5610b5395..f564a44ca46e 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -267,8 +267,18 @@ stdenv.mkDerivation ({ ++ (optional (perl != null) perl) ++ (optional javaAwtGtk pkgconfig); - buildInputs = [ gmp mpfr libmpc libelf ] - ++ (optional (cloog != null) cloog) + # For building runtime libs + depsBuildTarget = + if hostPlatform == buildPlatform then [ + targetPackages.stdenv.cc.bintools # newly-built gcc will be used + ] else assert targetPlatform == hostPlatform; [ # build != host == target + stdenv.cc + ]; + + buildInputs = [ + gmp mpfr libmpc libelf + targetPackages.stdenv.cc.bintools # For linking code at run-time + ] ++ (optional (cloog != null) cloog) ++ (optional (isl != null) isl) ++ (optional (zlib != null) zlib) ++ (optionals langJava [ boehmgc zip unzip ]) diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 3a7ad0a4c590..6ccd47c97291 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -49,9 +49,6 @@ assert libelf != null -> zlib != null; # Make sure we get GNU sed. assert hostPlatform.isDarwin -> gnused != null; -# Need c++filt on darwin -assert hostPlatform.isDarwin -> targetPackages.stdenv.cc.bintools or null != null; - # The go frontend is written in c++ assert langGo -> langCC; @@ -282,8 +279,18 @@ stdenv.mkDerivation ({ ++ (optional (perl != null) perl) ++ (optional javaAwtGtk pkgconfig); - buildInputs = [ gmp mpfr libmpc libelf ] - ++ (optional (isl != null) isl) + # For building runtime libs + depsBuildTarget = + if hostPlatform == buildPlatform then [ + targetPackages.stdenv.cc.bintools # newly-built gcc will be used + ] else assert targetPlatform == hostPlatform; [ # build != host == target + stdenv.cc + ]; + + buildInputs = [ + gmp mpfr libmpc libelf + targetPackages.stdenv.cc.bintools # For linking code at run-time + ] ++ (optional (isl != null) isl) ++ (optional (zlib != null) zlib) ++ (optionals langJava [ boehmgc zip unzip ]) ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 894abdb43fbc..ab4cdfe4db6e 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -49,9 +49,6 @@ assert libelf != null -> zlib != null; # Make sure we get GNU sed. assert hostPlatform.isDarwin -> gnused != null; -# Need c++filt on darwin -assert hostPlatform.isDarwin -> targetPackages.stdenv.cc.bintools or null != null; - # The go frontend is written in c++ assert langGo -> langCC; @@ -281,8 +278,18 @@ stdenv.mkDerivation ({ ++ (optional (perl != null) perl) ++ (optional javaAwtGtk pkgconfig); - buildInputs = [ gmp mpfr libmpc libelf ] - ++ (optional (isl != null) isl) + # For building runtime libs + depsBuildTarget = + if hostPlatform == buildPlatform then [ + targetPackages.stdenv.cc.bintools # newly-built gcc will be used + ] else assert targetPlatform == hostPlatform; [ # build != host == target + stdenv.cc + ]; + + buildInputs = [ + gmp mpfr libmpc libelf + targetPackages.stdenv.cc.bintools # For linking code at run-time + ] ++ (optional (isl != null) isl) ++ (optional (zlib != null) zlib) ++ (optionals langJava [ boehmgc zip unzip ]) ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 09e111f37fb7..acf61aea002b 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -50,9 +50,6 @@ assert libelf != null -> zlib != null; # Make sure we get GNU sed. assert hostPlatform.isDarwin -> gnused != null; -# Need c++filt on darwin -assert hostPlatform.isDarwin -> targetPackages.stdenv.cc.bintools or null != null; - # The go frontend is written in c++ assert langGo -> langCC; @@ -278,8 +275,18 @@ stdenv.mkDerivation ({ ++ (optional (perl != null) perl) ++ (optional javaAwtGtk pkgconfig); - buildInputs = [ gmp mpfr libmpc libelf flex ] - ++ (optional (isl != null) isl) + # For building runtime libs + depsBuildTarget = + if hostPlatform == buildPlatform then [ + targetPackages.stdenv.cc.bintools # newly-built gcc will be used + ] else assert targetPlatform == hostPlatform; [ # build != host == target + stdenv.cc + ]; + + buildInputs = [ + gmp mpfr libmpc libelf flex + targetPackages.stdenv.cc.bintools # For linking code at run-time + ] ++ (optional (isl != null) isl) ++ (optional (zlib != null) zlib) ++ (optionals langJava [ boehmgc zip unzip ]) ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index 955347809775..d48b7ba8d553 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -50,9 +50,6 @@ assert libelf != null -> zlib != null; # Make sure we get GNU sed. assert hostPlatform.isDarwin -> gnused != null; -# Need c++filt on darwin -assert hostPlatform.isDarwin -> targetPackages.stdenv.cc.bintools or null != null; - # The go frontend is written in c++ assert langGo -> langCC; @@ -265,8 +262,18 @@ stdenv.mkDerivation ({ ++ (optional (perl != null) perl) ++ (optional javaAwtGtk pkgconfig); - buildInputs = [ gmp mpfr libmpc libelf flex ] - ++ (optional (isl != null) isl) + # For building runtime libs + depsBuildTarget = + if hostPlatform == buildPlatform then [ + targetPackages.stdenv.cc.bintools # newly-built gcc will be used + ] else assert targetPlatform == hostPlatform; [ # build != host == target + stdenv.cc + ]; + + buildInputs = [ + gmp mpfr libmpc libelf flex + targetPackages.stdenv.cc.bintools # For linking code at run-time + ] ++ (optional (isl != null) isl) ++ (optional (zlib != null) zlib) ++ (optionals langJava [ boehmgc zip unzip ]) ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) -- cgit 1.4.1 From 0f5c80463176f7b146e8ef1943a3bbd61d4cbaf0 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 28 Nov 2017 18:15:31 -0500 Subject: gcc, binutils: Get rid of 32-bit ARM configure flag exception Now that we do `--enable-targes=all`, there is no risk of missing the needed emulation. This reverts commit ebc9b161cd184502bf4912b9348a507e2d0540da. This reverts commit 88efc22b44dedf423398491f9a55d1631b0b50ff. --- pkgs/development/compilers/gcc/4.5/default.nix | 6 +----- pkgs/development/compilers/gcc/4.8/default.nix | 6 +----- pkgs/development/compilers/gcc/4.9/default.nix | 6 +----- pkgs/development/compilers/gcc/5/default.nix | 6 +----- pkgs/development/compilers/gcc/6/default.nix | 6 +----- pkgs/development/compilers/gcc/7/default.nix | 6 +----- pkgs/development/compilers/gcc/snapshot/default.nix | 6 +----- pkgs/development/tools/misc/binutils/default.nix | 6 +----- 8 files changed, 8 insertions(+), 40 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 0d02d46d91bf..a312276b33e4 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -256,11 +256,7 @@ stdenv.mkDerivation ({ ; # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = - # TODO(@Ericson2314): Figure out what's going wrong with Arm - if hostPlatform == targetPlatform && targetPlatform.isArm - then [] - else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = # Basic dependencies diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index c828b7776adc..a55820d7e13d 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -298,11 +298,7 @@ stdenv.mkDerivation ({ 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.isArm - then [] - else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = # Basic dependencies diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index f564a44ca46e..6bb1f35bd99f 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -307,11 +307,7 @@ stdenv.mkDerivation ({ 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.isArm - then [] - else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = # Basic dependencies diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 6ccd47c97291..64922d83b508 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -316,11 +316,7 @@ stdenv.mkDerivation ({ 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.isArm - then [] - else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = # Basic dependencies diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index ab4cdfe4db6e..00f6cf8ab272 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -319,11 +319,7 @@ stdenv.mkDerivation ({ 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.isArm - then [] - else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = # Basic dependencies diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index acf61aea002b..5016735b56c5 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -312,11 +312,7 @@ stdenv.mkDerivation ({ 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.isArm - then [] - else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = # Basic dependencies diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index d48b7ba8d553..0b25d113b5ae 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -299,11 +299,7 @@ stdenv.mkDerivation ({ 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.isArm - then [] - else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = # Basic dependencies diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 9cf0e1236e0c..31c86c785c2d 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -91,11 +91,7 @@ stdenv.mkDerivation rec { else "-static-libgcc"; # TODO(@Ericson2314): Always pass "--target" and always targetPrefix. - configurePlatforms = - # TODO(@Ericson2314): Figure out what's going wrong with Arm - if hostPlatform == targetPlatform && targetPlatform.isArm - then [] - else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = [ "--enable-targets=all" "--enable-64-bit-bfd" -- cgit 1.4.1 From 4ad9a97e9678c70ca974c43fe3ef27f0e65af15a Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 28 Nov 2017 18:37:11 -0500 Subject: gcc: Don't let solaris hack pollute CC elsehwere --- pkgs/development/compilers/gcc/4.8/default.nix | 2 +- pkgs/development/compilers/gcc/4.9/default.nix | 2 +- pkgs/development/compilers/gcc/5/default.nix | 2 +- pkgs/development/compilers/gcc/6/default.nix | 2 +- pkgs/development/compilers/gcc/7/default.nix | 2 +- pkgs/development/compilers/gcc/snapshot/default.nix | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index a55820d7e13d..91daeadba707 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -399,7 +399,7 @@ stdenv.mkDerivation ({ }; # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - CC = if hostPlatform.system == "x86_64-solaris" then "gcc -m64" else "gcc"; + ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the # library headers and binaries, regarless of the language being compiled. diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 6bb1f35bd99f..844e0a7bebf4 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -407,7 +407,7 @@ stdenv.mkDerivation ({ }; # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - CC = if hostPlatform.system == "x86_64-solaris" then "gcc -m64" else "gcc"; + ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the # library headers and binaries, regarless of the language being compiled. diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 64922d83b508..148409bee9bf 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -412,7 +412,7 @@ stdenv.mkDerivation ({ }; # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - CC = if hostPlatform.system == "x86_64-solaris" then "gcc -m64" else "gcc"; + ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the # library headers and binaries, regarless of the language being compiled. diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 00f6cf8ab272..c6114b7e6395 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -414,7 +414,7 @@ stdenv.mkDerivation ({ }; # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - CC = if hostPlatform.system == "x86_64-solaris" then "gcc -m64" else "gcc"; + ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the # library headers and binaries, regarless of the language being compiled. diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 5016735b56c5..c20546b59e8e 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -408,7 +408,7 @@ stdenv.mkDerivation ({ }; # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - CC = if hostPlatform.system == "x86_64-solaris" then "gcc -m64" else "gcc"; + ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the # library headers and binaries, regarless of the language being compiled. diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index 0b25d113b5ae..c571487361b2 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -395,7 +395,7 @@ stdenv.mkDerivation ({ }; # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 - CC = if hostPlatform.system == "x86_64-solaris" then "gcc -m64" else "gcc"; + ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the # library headers and binaries, regarless of the language being compiled. -- cgit 1.4.1 From 3ed545ab31146e607c57649936c75869d6aa9ba2 Mon Sep 17 00:00:00 2001 From: Drew Hess Date: Mon, 8 Jan 2018 20:03:33 -0800 Subject: Revert "gcc, binutils: Get rid of 32-bit ARM configure flag exception" This commit breaks native armv7l-linux builds. Revert it until it can be root-caused. This reversion does not affect other platforms or cross-compiling. This reverts commit 0f5c80463176f7b146e8ef1943a3bbd61d4cbaf0. --- pkgs/development/compilers/gcc/4.5/default.nix | 6 +++++- pkgs/development/compilers/gcc/4.8/default.nix | 6 +++++- pkgs/development/compilers/gcc/4.9/default.nix | 6 +++++- pkgs/development/compilers/gcc/5/default.nix | 6 +++++- pkgs/development/compilers/gcc/6/default.nix | 6 +++++- pkgs/development/compilers/gcc/7/default.nix | 6 +++++- pkgs/development/compilers/gcc/snapshot/default.nix | 6 +++++- pkgs/development/tools/misc/binutils/default.nix | 6 +++++- 8 files changed, 40 insertions(+), 8 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 8f29d5f2cb14..5c7abe129238 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -256,7 +256,11 @@ stdenv.mkDerivation ({ ; # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = + # TODO(@Ericson2314): Figure out what's going wrong with Arm + if hostPlatform == targetPlatform && targetPlatform.isArm + then [] + else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = # Basic dependencies diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index a28ad871ead2..e2e01895c26a 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -298,7 +298,11 @@ stdenv.mkDerivation ({ dontDisableStatic = true; # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = + # TODO(@Ericson2314): Figure out what's going wrong with Arm + if hostPlatform == targetPlatform && targetPlatform.isArm + then [] + else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = # Basic dependencies diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 844e0a7bebf4..0a7bd4e0f8c1 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -307,7 +307,11 @@ stdenv.mkDerivation ({ dontDisableStatic = true; # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = + # TODO(@Ericson2314): Figure out what's going wrong with Arm + if hostPlatform == targetPlatform && targetPlatform.isArm + then [] + else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = # Basic dependencies diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 148409bee9bf..3128bc3b6735 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -316,7 +316,11 @@ stdenv.mkDerivation ({ dontDisableStatic = true; # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = + # TODO(@Ericson2314): Figure out what's going wrong with Arm + if hostPlatform == targetPlatform && targetPlatform.isArm + then [] + else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = # Basic dependencies diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index c6114b7e6395..96d88d3085bc 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -319,7 +319,11 @@ stdenv.mkDerivation ({ dontDisableStatic = true; # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = + # TODO(@Ericson2314): Figure out what's going wrong with Arm + if hostPlatform == targetPlatform && targetPlatform.isArm + then [] + else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = # Basic dependencies diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index c20546b59e8e..74ec6ee26a1e 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -312,7 +312,11 @@ stdenv.mkDerivation ({ dontDisableStatic = true; # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = + # TODO(@Ericson2314): Figure out what's going wrong with Arm + if hostPlatform == targetPlatform && targetPlatform.isArm + then [] + else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = # Basic dependencies diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index c571487361b2..0e126be553e0 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -299,7 +299,11 @@ stdenv.mkDerivation ({ dontDisableStatic = true; # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = + # TODO(@Ericson2314): Figure out what's going wrong with Arm + if hostPlatform == targetPlatform && targetPlatform.isArm + then [] + else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = # Basic dependencies diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 31c86c785c2d..9cf0e1236e0c 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -91,7 +91,11 @@ stdenv.mkDerivation rec { else "-static-libgcc"; # TODO(@Ericson2314): Always pass "--target" and always targetPrefix. - configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = + # TODO(@Ericson2314): Figure out what's going wrong with Arm + if hostPlatform == targetPlatform && targetPlatform.isArm + then [] + else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = [ "--enable-targets=all" "--enable-64-bit-bfd" -- cgit 1.4.1 From c98e6b67710c7c04ddab56cb09a14540e6668dbc Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 9 Jan 2018 17:25:49 -0500 Subject: gcc, binutils: Narrow down ARM hack so only native builds are affected --- pkgs/development/compilers/gcc/4.5/default.nix | 2 +- pkgs/development/compilers/gcc/4.8/default.nix | 2 +- pkgs/development/compilers/gcc/4.9/default.nix | 2 +- pkgs/development/compilers/gcc/5/default.nix | 2 +- pkgs/development/compilers/gcc/6/default.nix | 2 +- pkgs/development/compilers/gcc/7/default.nix | 2 +- pkgs/development/compilers/gcc/snapshot/default.nix | 2 +- pkgs/development/tools/misc/binutils/default.nix | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'pkgs/development/compilers/gcc/7') diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 5c7abe129238..6b2718f5e692 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -258,7 +258,7 @@ stdenv.mkDerivation ({ # TODO(@Ericson2314): Always pass "--target" and always prefix. configurePlatforms = # TODO(@Ericson2314): Figure out what's going wrong with Arm - if hostPlatform == targetPlatform && targetPlatform.isArm + if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isArm then [] else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index e2e01895c26a..0105a159877a 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -300,7 +300,7 @@ stdenv.mkDerivation ({ # TODO(@Ericson2314): Always pass "--target" and always prefix. configurePlatforms = # TODO(@Ericson2314): Figure out what's going wrong with Arm - if hostPlatform == targetPlatform && targetPlatform.isArm + if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isArm then [] else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 0a7bd4e0f8c1..1b1492686d0e 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -309,7 +309,7 @@ stdenv.mkDerivation ({ # TODO(@Ericson2314): Always pass "--target" and always prefix. configurePlatforms = # TODO(@Ericson2314): Figure out what's going wrong with Arm - if hostPlatform == targetPlatform && targetPlatform.isArm + if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isArm then [] else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 3128bc3b6735..0636ce7381ae 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -318,7 +318,7 @@ stdenv.mkDerivation ({ # TODO(@Ericson2314): Always pass "--target" and always prefix. configurePlatforms = # TODO(@Ericson2314): Figure out what's going wrong with Arm - if hostPlatform == targetPlatform && targetPlatform.isArm + if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isArm then [] else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 96d88d3085bc..2614e96e1b7c 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -321,7 +321,7 @@ stdenv.mkDerivation ({ # TODO(@Ericson2314): Always pass "--target" and always prefix. configurePlatforms = # TODO(@Ericson2314): Figure out what's going wrong with Arm - if hostPlatform == targetPlatform && targetPlatform.isArm + if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isArm then [] else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 74ec6ee26a1e..9ce3808b73f2 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -314,7 +314,7 @@ stdenv.mkDerivation ({ # TODO(@Ericson2314): Always pass "--target" and always prefix. configurePlatforms = # TODO(@Ericson2314): Figure out what's going wrong with Arm - if hostPlatform == targetPlatform && targetPlatform.isArm + if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isArm then [] else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index 0e126be553e0..c1306d374d5d 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -301,7 +301,7 @@ stdenv.mkDerivation ({ # TODO(@Ericson2314): Always pass "--target" and always prefix. configurePlatforms = # TODO(@Ericson2314): Figure out what's going wrong with Arm - if hostPlatform == targetPlatform && targetPlatform.isArm + if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isArm then [] else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 9cf0e1236e0c..05d0d21a179b 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -93,7 +93,7 @@ stdenv.mkDerivation rec { # TODO(@Ericson2314): Always pass "--target" and always targetPrefix. configurePlatforms = # TODO(@Ericson2314): Figure out what's going wrong with Arm - if hostPlatform == targetPlatform && targetPlatform.isArm + if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isArm then [] else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; -- cgit 1.4.1