git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #46857 from obsidiansystems/darwin-to-linux-prep

misc pkgs: various cross fixes in preparation for darwin->linux

commit35378f014161c1d794dc89b6969275396cb601de authorJohn Ericson <subscribe@JohnEricson.me> dateTue 18 Sep 2018, 16:52 (8 years ago) parent5664e642091133
12 files changed+44−37
pkgs/development/compilers/gcc/4.8/default.nix+4−2 pkgs/development/compilers/gcc/4.9/default.nix+4−2 pkgs/development/compilers/gcc/5/default.nix+4−2 pkgs/development/compilers/gcc/6/default.nix+4−5 pkgs/development/compilers/gcc/7/default.nix+4−5 pkgs/development/compilers/gcc/8/default.nix+4−5 pkgs/development/compilers/gcc/snapshot/default.nix+4−2 pkgs/development/libraries/glibc/default.nix+1−2 pkgs/stdenv/cross/default.nix+6−3 pkgs/stdenv/generic/make-derivation.nix+2−4 pkgs/stdenv/linux/default.nix+7−4 pkgs/top-level/all-packages.nix−1
pkgs/development/compilers/gcc/4.8/default.nix+4−2
@@ -116,6 +116,7 @@ let version = "4.8.5";
116116 "--enable-sjlj-exceptions"
117117 "--enable-threads=win32"
118118 "--disable-win32-registry"
119+ "--disable-libmpx" # requires libc
119120 ] else if crossStageStatic then [
120121 "--disable-libssp"
121122 "--disable-nls"
@@ -124,8 +125,9 @@ let version = "4.8.5";
124125 "--disable-libgomp"
125126 "--disable-libquadmath"
126127 "--disable-shared"
127− "--disable-libatomic" # libatomic requires libc
128− "--disable-decimal-float" # libdecnumber requires libc
128+ "--disable-libatomic" # requires libc
129+ "--disable-decimal-float" # requires libc
130+ "--disable-libmpx" # requires libc
129131 ] else [
130132 (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
131133 else "--with-headers=${getDev libcCross}/include")
pkgs/development/compilers/gcc/4.9/default.nix+4−2
@@ -121,6 +121,7 @@ let version = "4.9.4";
121121 "--enable-sjlj-exceptions"
122122 "--enable-threads=win32"
123123 "--disable-win32-registry"
124+ "--disable-libmpx" # requires libc
124125 ] else if crossStageStatic then [
125126 "--disable-libssp"
126127 "--disable-nls"
@@ -129,8 +130,9 @@ let version = "4.9.4";
129130 "--disable-libgomp"
130131 "--disable-libquadmath"
131132 "--disable-shared"
132− "--disable-libatomic" # libatomic requires libc
133− "--disable-decimal-float" # libdecnumber requires libc
133+ "--disable-libatomic" # requires libc
134+ "--disable-decimal-float" # requires libc
135+ "--disable-libmpx" # requires libc
134136 ] else [
135137 (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
136138 else "--with-headers=${getDev libcCross}/include")
pkgs/development/compilers/gcc/5/default.nix+4−2
@@ -107,6 +107,7 @@ let version = "5.5.0";
107107 "--enable-sjlj-exceptions"
108108 "--enable-threads=win32"
109109 "--disable-win32-registry"
110+ "--disable-libmpx" # requires libc
110111 ] else if crossStageStatic then [
111112 "--disable-libssp"
112113 "--disable-nls"
@@ -115,8 +116,9 @@ let version = "5.5.0";
115116 "--disable-libgomp"
116117 "--disable-libquadmath"
117118 "--disable-shared"
118− "--disable-libatomic" # libatomic requires libc
119− "--disable-decimal-float" # libdecnumber requires libc
119+ "--disable-libatomic" # requires libc
120+ "--disable-decimal-float" # requires libc
121+ "--disable-libmpx" # requires libc
120122 ] else [
121123 (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
122124 else "--with-headers=${getDev libcCross}/include")
pkgs/development/compilers/gcc/6/default.nix+4−5
@@ -105,6 +105,7 @@ let version = "6.4.0";
105105 "--enable-sjlj-exceptions"
106106 "--enable-threads=win32"
107107 "--disable-win32-registry"
108+ "--disable-libmpx" # requires libc
108109 ] else if crossStageStatic then [
109110 "--disable-libssp"
110111 "--disable-nls"
@@ -113,11 +114,9 @@ let version = "6.4.0";
113114 "--disable-libgomp"
114115 "--disable-libquadmath"
115116 "--disable-shared"
116− "--disable-libatomic" # libatomic requires libc
117− "--disable-decimal-float" # libdecnumber requires libc
118− # maybe only needed on musl, PATH_MAX
119− # https://github.com/richfelker/musl-cross-make/blob/0867cdf300618d1e3e87a0a939fa4427207ad9d7/litecross/Makefile#L62
120− "--disable-libmpx"
117+ "--disable-libatomic" # requires libc
118+ "--disable-decimal-float" # requires libc
119+ "--disable-libmpx" # requires libc
121120 ] else [
122121 (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
123122 else "--with-headers=${getDev libcCross}/include")
pkgs/development/compilers/gcc/7/default.nix+4−5
@@ -77,6 +77,7 @@ let version = "7.3.0";
7777 "--enable-sjlj-exceptions"
7878 "--enable-threads=win32"
7979 "--disable-win32-registry"
80+ "--disable-libmpx" # requires libc
8081 ] else if crossStageStatic then [
8182 "--disable-libssp"
8283 "--disable-nls"
@@ -85,11 +86,9 @@ let version = "7.3.0";
8586 "--disable-libgomp"
8687 "--disable-libquadmath"
8788 "--disable-shared"
88− "--disable-libatomic" # libatomic requires libc
89− "--disable-decimal-float" # libdecnumber requires libc
90− # maybe only needed on musl, PATH_MAX
91− # https://github.com/richfelker/musl-cross-make/blob/0867cdf300618d1e3e87a0a939fa4427207ad9d7/litecross/Makefile#L62
92− "--disable-libmpx"
89+ "--disable-libatomic" # requires libc
90+ "--disable-decimal-float" # requires libc
91+ "--disable-libmpx" # requires libc
9392 ] else [
9493 (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
9594 else "--with-headers=${getDev libcCross}/include")
pkgs/development/compilers/gcc/8/default.nix+4−5
@@ -72,6 +72,7 @@ let version = "8.2.0";
7272 "--enable-sjlj-exceptions"
7373 "--enable-threads=win32"
7474 "--disable-win32-registry"
75+ "--disable-libmpx" # requires libc
7576 ] else if crossStageStatic then [
7677 "--disable-libssp"
7778 "--disable-nls"
@@ -80,11 +81,9 @@ let version = "8.2.0";
8081 "--disable-libgomp"
8182 "--disable-libquadmath"
8283 "--disable-shared"
83− "--disable-libatomic" # libatomic requires libc
84− "--disable-decimal-float" # libdecnumber requires libc
85− # maybe only needed on musl, PATH_MAX
86− # https://github.com/richfelker/musl-cross-make/blob/0867cdf300618d1e3e87a0a939fa4427207ad9d7/litecross/Makefile#L62
87− "--disable-libmpx"
84+ "--disable-libatomic" # requires libc
85+ "--disable-decimal-float" # requires libc
86+ "--disable-libmpx" # requires libc
8887 ] else [
8988 (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
9089 else "--with-headers=${getDev libcCross}/include")
pkgs/development/compilers/gcc/snapshot/default.nix+4−2
@@ -69,6 +69,7 @@ let version = "7-20170409";
6969 "--enable-sjlj-exceptions"
7070 "--enable-threads=win32"
7171 "--disable-win32-registry"
72+ "--disable-libmpx" # requires libc
7273 ] else if crossStageStatic then [
7374 "--disable-libssp"
7475 "--disable-nls"
@@ -77,8 +78,9 @@ let version = "7-20170409";
7778 "--disable-libgomp"
7879 "--disable-libquadmath"
7980 "--disable-shared"
80− "--disable-libatomic" # libatomic requires libc
81− "--disable-decimal-float" # libdecnumber requires libc
81+ "--disable-libatomic" # requires libc
82+ "--disable-decimal-float" # requires libc
83+ "--disable-libmpx" # requires libc
8284 ] else [
8385 (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
8486 else "--with-headers=${getDev libcCross}/include")
pkgs/development/libraries/glibc/default.nix+1−2
@@ -94,8 +94,7 @@ callPackage ./common.nix { inherit stdenv; } {
9494 mv $bin/bin/getconf_ $bin/bin/getconf
9595 '';
9696
97− # Hack to get around eval issue.
98− separateDebugInfo = !stdenv.isDarwin;
97+ separateDebugInfo = true;
9998
10099 meta.description = "The GNU C Library";
101100 }
pkgs/stdenv/cross/default.nix+6−3
@@ -53,12 +53,15 @@ in lib.init bootStages ++ [
5353 else buildPackages.gcc;
5454
5555 extraNativeBuildInputs = old.extraNativeBuildInputs
56+ ++ lib.optionals
57+ (hostPlatform.isLinux && !buildPlatform.isLinux)
58+ [ buildPackages.patchelf buildPackages.paxctl ]
59+ ++ lib.optional
60+ (let f = p: !p.isx86 || p.libc == "musl"; in f hostPlatform && !(f buildPlatform))
61+ buildPackages.updateAutotoolsGnuConfigScriptsHook
5662 # without proper `file` command, libtool sometimes fails
5763 # to recognize 64-bit DLLs
5864 ++ lib.optional (hostPlatform.config == "x86_64-w64-mingw32") buildPackages.file
59− ++ lib.optional
60− (hostPlatform.isAarch64 || hostPlatform.isMips || hostPlatform.libc == "musl")
61− buildPackages.updateAutotoolsGnuConfigScriptsHook
6265 ;
6366 });
6467 })
pkgs/stdenv/generic/make-derivation.nix+2−4
@@ -83,9 +83,7 @@ rec {
8383 doCheck' = doCheck && stdenv.hostPlatform == stdenv.buildPlatform;
8484 doInstallCheck' = doInstallCheck && stdenv.hostPlatform == stdenv.buildPlatform;
8585
86− outputs' =
87− outputs ++
88− (if separateDebugInfo then assert stdenv.hostPlatform.isLinux; [ "debug" ] else []);
86+ outputs' = outputs ++ lib.optional separateDebugInfo "debug";
8987
9088 fixedOutputDrv = attrs ? outputHash;
9189 noNonNativeDeps = builtins.length (depsBuildTarget ++ depsBuildTargetPropagated
@@ -176,7 +174,7 @@ rec {
176174 // {
177175 # A hack to make `nix-env -qa` and `nix search` ignore broken packages.
178176 # TODO(@oxij): remove this assert when something like NixOS/nix#1771 gets merged into nix.
179− name = assert validity.handled; name + lib.optionalString
177+ name = assert validity.handled && (separateDebugInfo -> stdenv.hostPlatform.isLinux); name + lib.optionalString
180178 # Fixed-output derivations like source tarballs shouldn't get a host
181179 # suffix. But we have some weird ones with run-time deps that are
182180 # just used for their side-affects. Those might as well since the
pkgs/stdenv/linux/default.nix+7−4
@@ -251,7 +251,8 @@ in
251251 };
252252 extraNativeBuildInputs = [ prevStage.patchelf prevStage.paxctl ] ++
253253 # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64.
254− lib.optional (!localSystem.isx86) prevStage.updateAutotoolsGnuConfigScriptsHook;
254+ lib.optional (!localSystem.isx86 || localSystem.libc == "musl")
255+ prevStage.updateAutotoolsGnuConfigScriptsHook;
255256 })
256257
257258
@@ -292,7 +293,8 @@ in
292293 };
293294 extraNativeBuildInputs = [ prevStage.patchelf prevStage.xz ] ++
294295 # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64.
295− lib.optional (!localSystem.isx86) prevStage.updateAutotoolsGnuConfigScriptsHook;
296+ lib.optional (!localSystem.isx86 || localSystem.libc == "musl")
297+ prevStage.updateAutotoolsGnuConfigScriptsHook;
296298 })
297299
298300 # Construct the final stdenv. It uses the Glibc and GCC, and adds
@@ -324,7 +326,8 @@ in
324326
325327 extraNativeBuildInputs = [ prevStage.patchelf prevStage.paxctl ] ++
326328 # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64.
327− lib.optional (!localSystem.isx86) prevStage.updateAutotoolsGnuConfigScriptsHook;
329+ lib.optional (!localSystem.isx86 || localSystem.libc == "musl")
330+ prevStage.updateAutotoolsGnuConfigScriptsHook;
328331
329332 cc = prevStage.gcc;
330333
@@ -357,7 +360,7 @@ in
357360 ++ [ /*propagated from .dev*/ linuxHeaders
358361 binutils gcc gcc.cc gcc.cc.lib gcc.expand-response-params
359362 ]
360− ++ lib.optionals (!localSystem.isx86)
363+ ++ lib.optionals (!localSystem.isx86 || localSystem.libc == "musl")
361364 [ prevStage.updateAutotoolsGnuConfigScriptsHook prevStage.gnu-config ];
362365
363366 overrides = self: super: {
pkgs/top-level/all-packages.nix−1
@@ -6509,7 +6509,6 @@ with pkgs;
65096509 libcCross1 =
65106510 if stdenv.targetPlatform.libc == "msvcrt" then targetPackages.windows.mingw_w64_headers
65116511 else if stdenv.targetPlatform.libc == "libSystem" then darwin.xcode
6512− else if stdenv.targetPlatform.libc == "musl" then musl
65136512 else null;
65146513 binutils1 = wrapBintoolsWith {
65156514 bintools = binutils-unwrapped;