binutilsCross: Remove and use `binutils` instead always

See previous commit for what was done to `binutils` to make this
possible.

There were some uses of `forcedNativePackages` added. The
combination of overrides with that attribute is highly spooky: it's
often important that if an overridden package comes from it, the
replaced arguments for that package come from it. Long term this
package set and all the spookiness should be gone and irrelevant:

"Move along, nothing to see here!"

No hashes should be changed with this commit

+40 -53
+1 -2
pkgs/development/compilers/gcc/4.5/default.nix
··· 20 , enableMultilib ? false 21 , name ? "gcc" 22 , cross ? null 23 - , binutilsCross ? null 24 , libcCross ? null 25 , crossStageStatic ? true 26 , gnat ? null ··· 225 ++ (optional langJava boehmgc) 226 ++ (optionals langJava [zip unzip]) 227 ++ (optionals javaAwtGtk ([gtk2 pkgconfig libart_lgpl] ++ xlibs)) 228 - ++ (optionals (cross != null) [binutilsCross]) 229 ++ (optionals langAda [gnatboot]) 230 ++ (optionals langVhdl [gnat]) 231 ;
··· 20 , enableMultilib ? false 21 , name ? "gcc" 22 , cross ? null 23 , libcCross ? null 24 , crossStageStatic ? true 25 , gnat ? null ··· 224 ++ (optional langJava boehmgc) 225 ++ (optionals langJava [zip unzip]) 226 ++ (optionals javaAwtGtk ([gtk2 pkgconfig libart_lgpl] ++ xlibs)) 227 + ++ (optionals (cross != null) [binutils]) 228 ++ (optionals langAda [gnatboot]) 229 ++ (optionals langVhdl [gnat]) 230 ;
+3 -4
pkgs/development/compilers/gcc/4.8/default.nix
··· 26 , enablePlugin ? true # whether to support user-supplied plug-ins 27 , name ? "gcc" 28 , cross ? null 29 - , binutilsCross ? null 30 , libcCross ? null 31 , crossStageStatic ? true 32 , gnat ? null ··· 171 else " --with-headers=${libcCross.dev}/include") + 172 # Ensure that -print-prog-name is able to find the correct programs. 173 (stdenv.lib.optionalString (crossMingw || crossDarwin) ( 174 - " --with-as=${binutilsCross}/bin/${cross.config}-as" + 175 - " --with-ld=${binutilsCross}/bin/${cross.config}-ld" 176 )) + 177 " --enable-__cxa_atexit" + 178 " --enable-long-long" + ··· 294 ++ (optional (zlib != null) zlib) 295 ++ (optionals langJava [ boehmgc zip unzip ]) 296 ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) 297 - ++ (optionals (cross != null) [binutilsCross]) 298 ++ (optionals langAda [gnatboot]) 299 ++ (optionals langVhdl [gnat]) 300
··· 26 , enablePlugin ? true # whether to support user-supplied plug-ins 27 , name ? "gcc" 28 , cross ? null 29 , libcCross ? null 30 , crossStageStatic ? true 31 , gnat ? null ··· 170 else " --with-headers=${libcCross.dev}/include") + 171 # Ensure that -print-prog-name is able to find the correct programs. 172 (stdenv.lib.optionalString (crossMingw || crossDarwin) ( 173 + " --with-as=${binutils}/bin/${cross.config}-as" + 174 + " --with-ld=${binutils}/bin/${cross.config}-ld" 175 )) + 176 " --enable-__cxa_atexit" + 177 " --enable-long-long" + ··· 293 ++ (optional (zlib != null) zlib) 294 ++ (optionals langJava [ boehmgc zip unzip ]) 295 ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) 296 + ++ (optionals (cross != null) [binutils]) 297 ++ (optionals langAda [gnatboot]) 298 ++ (optionals langVhdl [gnat]) 299
+3 -4
pkgs/development/compilers/gcc/4.9/default.nix
··· 26 , enablePlugin ? true # whether to support user-supplied plug-ins 27 , name ? "gcc" 28 , cross ? null 29 - , binutilsCross ? null 30 , libcCross ? null 31 , crossStageStatic ? true 32 , gnat ? null ··· 172 else " --with-headers=${libcCross.dev}/include") + 173 # Ensure that -print-prog-name is able to find the correct programs. 174 (stdenv.lib.optionalString (crossMingw || crossDarwin) ( 175 - " --with-as=${binutilsCross}/bin/${cross.config}-as" + 176 - " --with-ld=${binutilsCross}/bin/${cross.config}-ld" 177 )) + 178 " --enable-__cxa_atexit" + 179 " --enable-long-long" + ··· 299 ++ (optional (zlib != null) zlib) 300 ++ (optionals langJava [ boehmgc zip unzip ]) 301 ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) 302 - ++ (optionals (cross != null) [binutilsCross]) 303 ++ (optionals langAda [gnatboot]) 304 ++ (optionals langVhdl [gnat]) 305
··· 26 , enablePlugin ? true # whether to support user-supplied plug-ins 27 , name ? "gcc" 28 , cross ? null 29 , libcCross ? null 30 , crossStageStatic ? true 31 , gnat ? null ··· 171 else " --with-headers=${libcCross.dev}/include") + 172 # Ensure that -print-prog-name is able to find the correct programs. 173 (stdenv.lib.optionalString (crossMingw || crossDarwin) ( 174 + " --with-as=${binutils}/bin/${cross.config}-as" + 175 + " --with-ld=${binutils}/bin/${cross.config}-ld" 176 )) + 177 " --enable-__cxa_atexit" + 178 " --enable-long-long" + ··· 298 ++ (optional (zlib != null) zlib) 299 ++ (optionals langJava [ boehmgc zip unzip ]) 300 ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) 301 + ++ (optionals (cross != null) [binutils]) 302 ++ (optionals langAda [gnatboot]) 303 ++ (optionals langVhdl [gnat]) 304
+3 -4
pkgs/development/compilers/gcc/5/default.nix
··· 26 , enablePlugin ? true # whether to support user-supplied plug-ins 27 , name ? "gcc" 28 , cross ? null 29 - , binutilsCross ? null 30 , libcCross ? null 31 , crossStageStatic ? true 32 , gnat ? null ··· 176 else " --with-headers=${getDev libcCross}/include") + 177 # Ensure that -print-prog-name is able to find the correct programs. 178 (stdenv.lib.optionalString (crossMingw || crossDarwin) ( 179 - " --with-as=${binutilsCross}/bin/${cross.config}-as" + 180 - " --with-ld=${binutilsCross}/bin/${cross.config}-ld" 181 )) + 182 " --enable-__cxa_atexit" + 183 " --enable-long-long" + ··· 309 ++ (optional (zlib != null) zlib) 310 ++ (optionals langJava [ boehmgc zip unzip ]) 311 ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) 312 - ++ (optionals (cross != null) [binutilsCross]) 313 ++ (optionals langAda [gnatboot]) 314 ++ (optionals langVhdl [gnat]) 315
··· 26 , enablePlugin ? true # whether to support user-supplied plug-ins 27 , name ? "gcc" 28 , cross ? null 29 , libcCross ? null 30 , crossStageStatic ? true 31 , gnat ? null ··· 175 else " --with-headers=${getDev libcCross}/include") + 176 # Ensure that -print-prog-name is able to find the correct programs. 177 (stdenv.lib.optionalString (crossMingw || crossDarwin) ( 178 + " --with-as=${binutils}/bin/${cross.config}-as" + 179 + " --with-ld=${binutils}/bin/${cross.config}-ld" 180 )) + 181 " --enable-__cxa_atexit" + 182 " --enable-long-long" + ··· 308 ++ (optional (zlib != null) zlib) 309 ++ (optionals langJava [ boehmgc zip unzip ]) 310 ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) 311 + ++ (optionals (cross != null) [binutils]) 312 ++ (optionals langAda [gnatboot]) 313 ++ (optionals langVhdl [gnat]) 314
+3 -4
pkgs/development/compilers/gcc/6/default.nix
··· 26 , enablePlugin ? true # whether to support user-supplied plug-ins 27 , name ? "gcc" 28 , cross ? null 29 - , binutilsCross ? null 30 , libcCross ? null 31 , crossStageStatic ? true 32 , gnat ? null ··· 172 else " --with-headers=${getDev libcCross}/include") + 173 # Ensure that -print-prog-name is able to find the correct programs. 174 (stdenv.lib.optionalString (crossMingw || crossDarwin) ( 175 - " --with-as=${binutilsCross}/bin/${cross.config}-as" + 176 - " --with-ld=${binutilsCross}/bin/${cross.config}-ld" 177 )) + 178 " --enable-__cxa_atexit" + 179 " --enable-long-long" + ··· 297 ++ (optional (zlib != null) zlib) 298 ++ (optionals langJava [ boehmgc zip unzip ]) 299 ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) 300 - ++ (optionals (cross != null) [binutilsCross]) 301 ++ (optionals langAda [gnatboot]) 302 ++ (optionals langVhdl [gnat]) 303
··· 26 , enablePlugin ? true # whether to support user-supplied plug-ins 27 , name ? "gcc" 28 , cross ? null 29 , libcCross ? null 30 , crossStageStatic ? true 31 , gnat ? null ··· 171 else " --with-headers=${getDev libcCross}/include") + 172 # Ensure that -print-prog-name is able to find the correct programs. 173 (stdenv.lib.optionalString (crossMingw || crossDarwin) ( 174 + " --with-as=${binutils}/bin/${cross.config}-as" + 175 + " --with-ld=${binutils}/bin/${cross.config}-ld" 176 )) + 177 " --enable-__cxa_atexit" + 178 " --enable-long-long" + ··· 296 ++ (optional (zlib != null) zlib) 297 ++ (optionals langJava [ boehmgc zip unzip ]) 298 ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) 299 + ++ (optionals (cross != null) [binutils]) 300 ++ (optionals langAda [gnatboot]) 301 ++ (optionals langVhdl [gnat]) 302
+3 -4
pkgs/development/compilers/gcc/snapshot/default.nix
··· 26 , enablePlugin ? true # whether to support user-supplied plug-ins 27 , name ? "gcc" 28 , cross ? null 29 - , binutilsCross ? null 30 , libcCross ? null 31 , crossStageStatic ? true 32 , gnat ? null ··· 172 else " --with-headers=${getDev libcCross}/include") + 173 # Ensure that -print-prog-name is able to find the correct programs. 174 (stdenv.lib.optionalString (crossMingw || crossDarwin) ( 175 - " --with-as=${binutilsCross}/bin/${cross.config}-as" + 176 - " --with-ld=${binutilsCross}/bin/${cross.config}-ld" 177 )) + 178 " --enable-__cxa_atexit" + 179 " --enable-long-long" + ··· 297 ++ (optional (zlib != null) zlib) 298 ++ (optionals langJava [ boehmgc zip unzip ]) 299 ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) 300 - ++ (optionals (cross != null) [binutilsCross]) 301 ++ (optionals langAda [gnatboot]) 302 ++ (optionals langVhdl [gnat]) 303
··· 26 , enablePlugin ? true # whether to support user-supplied plug-ins 27 , name ? "gcc" 28 , cross ? null 29 , libcCross ? null 30 , crossStageStatic ? true 31 , gnat ? null ··· 171 else " --with-headers=${getDev libcCross}/include") + 172 # Ensure that -print-prog-name is able to find the correct programs. 173 (stdenv.lib.optionalString (crossMingw || crossDarwin) ( 174 + " --with-as=${binutils}/bin/${cross.config}-as" + 175 + " --with-ld=${binutils}/bin/${cross.config}-ld" 176 )) + 177 " --enable-__cxa_atexit" + 178 " --enable-long-long" + ··· 296 ++ (optional (zlib != null) zlib) 297 ++ (optionals langJava [ boehmgc zip unzip ]) 298 ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) 299 + ++ (optionals (cross != null) [binutils]) 300 ++ (optionals langAda [gnatboot]) 301 ++ (optionals langVhdl [gnat]) 302
+6 -6
pkgs/development/compilers/ghc/head.nix
··· 99 100 configureFlags = [ 101 "CC=${stdenv.ccCross}/bin/${cross.config}-cc" 102 - "LD=${stdenv.binutilsCross}/bin/${cross.config}-ld" 103 - "AR=${stdenv.binutilsCross}/bin/${cross.config}-ar" 104 - "NM=${stdenv.binutilsCross}/bin/${cross.config}-nm" 105 - "RANLIB=${stdenv.binutilsCross}/bin/${cross.config}-ranlib" 106 "--target=${cross.config}" 107 "--enable-bootstrap-with-devel-snapshot" 108 ] ++ 109 # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ 110 lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space"; 111 112 - buildInputs = commonBuildInputs ++ [ stdenv.ccCross stdenv.binutilsCross ]; 113 114 dontSetConfigureCross = true; 115 ··· 118 119 cc = "${stdenv.ccCross}/bin/${cross.config}-cc"; 120 121 - ld = "${stdenv.binutilsCross}/bin/${cross.config}-ld"; 122 }; 123 })
··· 99 100 configureFlags = [ 101 "CC=${stdenv.ccCross}/bin/${cross.config}-cc" 102 + "LD=${stdenv.binutils}/bin/${cross.config}-ld" 103 + "AR=${stdenv.binutils}/bin/${cross.config}-ar" 104 + "NM=${stdenv.binutils}/bin/${cross.config}-nm" 105 + "RANLIB=${stdenv.binutils}/bin/${cross.config}-ranlib" 106 "--target=${cross.config}" 107 "--enable-bootstrap-with-devel-snapshot" 108 ] ++ 109 # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ 110 lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space"; 111 112 + buildInputs = commonBuildInputs ++ [ stdenv.ccCross stdenv.binutils ]; 113 114 dontSetConfigureCross = true; 115 ··· 118 119 cc = "${stdenv.ccCross}/bin/${cross.config}-cc"; 120 121 + ld = "${stdenv.binutils}/bin/${cross.config}-ld"; 122 }; 123 })
+2 -2
pkgs/os-specific/windows/mingw-w64/default.nix
··· 1 - { stdenv, fetchurl, binutilsCross ? null, gccCross ? null 2 , onlyHeaders ? false 3 , onlyPthreads ? false 4 }: ··· 27 cd mingw-w64-libraries/winpthreads 28 ''; 29 } else { 30 - buildInputs = [ gccCross binutilsCross ]; 31 32 crossConfig = gccCross.crossConfig; 33
··· 1 + { stdenv, fetchurl, binutils ? null, gccCross ? null 2 , onlyHeaders ? false 3 , onlyPthreads ? false 4 }: ··· 27 cd mingw-w64-libraries/winpthreads 28 ''; 29 } else { 30 + buildInputs = [ gccCross binutils ]; 31 32 crossConfig = gccCross.crossConfig; 33
+2 -2
pkgs/os-specific/windows/mingwrt/default.nix
··· 1 - {stdenv, fetchurl, binutilsCross ? null, gccCross ? null, onlyHeaders ? false}: 2 3 let 4 name = "mingwrt-3.20"; ··· 20 cp -R include $out 21 ''; 22 } else { 23 - buildInputs = [ gccCross binutilsCross ]; 24 25 crossConfig = gccCross.crossConfig; 26
··· 1 + {stdenv, fetchurl, binutils ? null, gccCross ? null, onlyHeaders ? false}: 2 3 let 4 name = "mingwrt-3.20"; ··· 20 cp -R include $out 21 ''; 22 } else { 23 + buildInputs = [ gccCross binutils ]; 24 25 crossConfig = gccCross.crossConfig; 26
+2 -2
pkgs/os-specific/windows/w32api/default.nix
··· 1 - { stdenv, fetchurl, xz, binutilsCross ? null 2 , gccCross ? null, onlyHeaders ? false }: 3 4 let ··· 23 cp -R include $out 24 ''; 25 } else { 26 - buildInputs = [ gccCross binutilsCross ]; 27 28 crossConfig = gccCross.crossConfig; 29
··· 1 + { stdenv, fetchurl, xz, binutils ? null 2 , gccCross ? null, onlyHeaders ? false }: 3 4 let ··· 23 cp -R include $out 24 ''; 25 } else { 26 + buildInputs = [ gccCross binutils ]; 27 28 crossConfig = gccCross.crossConfig; 29
+3 -3
pkgs/stdenv/adapters.nix
··· 56 57 # Return a modified stdenv that adds a cross compiler to the 58 # builds. 59 - makeStdenvCross = stdenv: cross: binutilsCross: gccCross: stdenv // { 60 61 # Overrides are surely not valid as packages built with this run on a 62 # different platform. ··· 91 name = name + "-" + cross.config; 92 nativeBuildInputs = nativeBuildInputs 93 ++ nativeInputsFromBuildInputs 94 - ++ [ gccCross binutilsCross ] 95 ++ stdenv.lib.optional selfNativeBuildInput nativeDrv 96 # without proper `file` command, libtool sometimes fails 97 # to recognize 64-bit DLLs ··· 110 crossConfig = cross.config; 111 } // args.crossAttrs or {}); 112 113 - inherit gccCross binutilsCross; 114 ccCross = gccCross; 115 116 };
··· 56 57 # Return a modified stdenv that adds a cross compiler to the 58 # builds. 59 + makeStdenvCross = stdenv: cross: binutils: gccCross: stdenv // { 60 61 # Overrides are surely not valid as packages built with this run on a 62 # different platform. ··· 91 name = name + "-" + cross.config; 92 nativeBuildInputs = nativeBuildInputs 93 ++ nativeInputsFromBuildInputs 94 + ++ [ gccCross binutils ] 95 ++ stdenv.lib.optional selfNativeBuildInput nativeDrv 96 # without proper `file` command, libtool sometimes fails 97 # to recognize 64-bit DLLs ··· 110 crossConfig = cross.config; 111 } // args.crossAttrs or {}); 112 113 + inherit gccCross binutils; 114 ccCross = gccCross; 115 116 };
+1 -1
pkgs/stdenv/cross/default.nix
··· 39 binutils cc 40 else buildPackages.makeStdenvCross 41 buildPackages.stdenv crossSystem 42 - buildPackages.binutilsCross buildPackages.gccCrossStageFinal; 43 }) 44 45 ]
··· 39 binutils cc 40 else buildPackages.makeStdenvCross 41 buildPackages.stdenv crossSystem 42 + buildPackages.binutils buildPackages.gccCrossStageFinal; 43 }) 44 45 ]
+8 -15
pkgs/top-level/all-packages.nix
··· 4982 libcCross = libcCross1; 4983 enableShared = false; 4984 # Why is this needed? 4985 - inherit (forcedNativePackages) binutilsCross; 4986 }; 4987 libc = libcCross1; 4988 - binutils = binutilsCross; 4989 cross = targetPlatform; 4990 }; 4991 ··· 4993 gccCrossMingw2 = assert targetPlatform != buildPlatform; wrapGCCCross { 4994 gcc = gccCrossStageStatic.gcc; 4995 libc = windows.mingw_headers2; 4996 - binutils = binutilsCross; 4997 cross = targetPlatform; 4998 }; 4999 ··· 5006 # <http://hydra.nixos.org/build/4268232>), so don't even try. 5007 langCC = targetPlatform.config != "i686-pc-mingw32"; 5008 # Why is this needed? 5009 - inherit (forcedNativePackages) binutilsCross; 5010 }; 5011 libc = libcCross; 5012 - binutils = binutilsCross; 5013 cross = targetPlatform; 5014 }; 5015 ··· 6345 binutils_nogold = lowPrio (binutils-raw.override { 6346 gold = false; 6347 }); 6348 - 6349 - binutilsCross = assert targetPlatform != buildPlatform; lowPrio ( 6350 - if targetPlatform.libc == "libSystem" then darwin.cctools_cross 6351 - else forcedNativePackages.binutils.override { 6352 - noSysDirs = true; 6353 - cross = targetPlatform; 6354 - }); 6355 6356 bison2 = callPackage ../development/tools/parsing/bison/2.x.nix { }; 6357 bison3 = callPackage ../development/tools/parsing/bison/3.x.nix { }; ··· 12305 12306 w32api = callPackage ../os-specific/windows/w32api { 12307 gccCross = gccCrossStageStatic; 12308 - binutilsCross = binutilsCross; 12309 }; 12310 12311 w32api_headers = w32api.override { ··· 12314 12315 mingw_runtime = callPackage ../os-specific/windows/mingwrt { 12316 gccCross = gccCrossMingw2; 12317 - binutilsCross = binutilsCross; 12318 }; 12319 12320 mingw_runtime_headers = mingw_runtime.override { ··· 12338 12339 mingw_w64 = callPackage ../os-specific/windows/mingw-w64 { 12340 gccCross = gccCrossStageStatic; 12341 - binutilsCross = binutilsCross; 12342 }; 12343 12344 mingw_w64_headers = callPackage ../os-specific/windows/mingw-w64 {
··· 4982 libcCross = libcCross1; 4983 enableShared = false; 4984 # Why is this needed? 4985 + inherit (forcedNativePackages) binutils; 4986 }; 4987 libc = libcCross1; 4988 + inherit (forcedNativePackages) binutils; 4989 cross = targetPlatform; 4990 }; 4991 ··· 4993 gccCrossMingw2 = assert targetPlatform != buildPlatform; wrapGCCCross { 4994 gcc = gccCrossStageStatic.gcc; 4995 libc = windows.mingw_headers2; 4996 + inherit (forcedNativePackages) binutils; 4997 cross = targetPlatform; 4998 }; 4999 ··· 5006 # <http://hydra.nixos.org/build/4268232>), so don't even try. 5007 langCC = targetPlatform.config != "i686-pc-mingw32"; 5008 # Why is this needed? 5009 + inherit (forcedNativePackages) binutils; 5010 }; 5011 libc = libcCross; 5012 + inherit (forcedNativePackages) binutils; 5013 cross = targetPlatform; 5014 }; 5015 ··· 6345 binutils_nogold = lowPrio (binutils-raw.override { 6346 gold = false; 6347 }); 6348 6349 bison2 = callPackage ../development/tools/parsing/bison/2.x.nix { }; 6350 bison3 = callPackage ../development/tools/parsing/bison/3.x.nix { }; ··· 12298 12299 w32api = callPackage ../os-specific/windows/w32api { 12300 gccCross = gccCrossStageStatic; 12301 + binutils = binutils; 12302 }; 12303 12304 w32api_headers = w32api.override { ··· 12307 12308 mingw_runtime = callPackage ../os-specific/windows/mingwrt { 12309 gccCross = gccCrossMingw2; 12310 + binutils = binutils; 12311 }; 12312 12313 mingw_runtime_headers = mingw_runtime.override { ··· 12331 12332 mingw_w64 = callPackage ../os-specific/windows/mingw-w64 { 12333 gccCross = gccCrossStageStatic; 12334 + binutils = binutils; 12335 }; 12336 12337 mingw_w64_headers = callPackage ../os-specific/windows/mingw-w64 {