diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index ed185b4be1a2..60db368c403a 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -116,6 +116,7 @@ let version = "4.8.5"; "--enable-sjlj-exceptions" "--enable-threads=win32" "--disable-win32-registry" + "--disable-libmpx" # requires libc ] else if crossStageStatic then [ "--disable-libssp" "--disable-nls" @@ -124,8 +125,9 @@ let version = "4.8.5"; "--disable-libgomp" "--disable-libquadmath" "--disable-shared" - "--disable-libatomic" # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc + "--disable-libatomic" # requires libc + "--disable-decimal-float" # requires libc + "--disable-libmpx" # requires libc ] else [ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" else "--with-headers=${getDev libcCross}/include") diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 3f13562c1b8c..361db92cb767 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -121,6 +121,7 @@ let version = "4.9.4"; "--enable-sjlj-exceptions" "--enable-threads=win32" "--disable-win32-registry" + "--disable-libmpx" # requires libc ] else if crossStageStatic then [ "--disable-libssp" "--disable-nls" @@ -129,8 +130,9 @@ let version = "4.9.4"; "--disable-libgomp" "--disable-libquadmath" "--disable-shared" - "--disable-libatomic" # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc + "--disable-libatomic" # requires libc + "--disable-decimal-float" # requires libc + "--disable-libmpx" # requires libc ] else [ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" else "--with-headers=${getDev libcCross}/include") diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 497ca40c3ae6..2e51e9c05066 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -107,6 +107,7 @@ let version = "5.5.0"; "--enable-sjlj-exceptions" "--enable-threads=win32" "--disable-win32-registry" + "--disable-libmpx" # requires libc ] else if crossStageStatic then [ "--disable-libssp" "--disable-nls" @@ -115,8 +116,9 @@ let version = "5.5.0"; "--disable-libgomp" "--disable-libquadmath" "--disable-shared" - "--disable-libatomic" # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc + "--disable-libatomic" # requires libc + "--disable-decimal-float" # requires libc + "--disable-libmpx" # requires libc ] else [ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" else "--with-headers=${getDev libcCross}/include") diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 3f5d3172d12f..e6825afcfa84 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -105,6 +105,7 @@ let version = "6.4.0"; "--enable-sjlj-exceptions" "--enable-threads=win32" "--disable-win32-registry" + "--disable-libmpx" # requires libc ] else if crossStageStatic then [ "--disable-libssp" "--disable-nls" @@ -113,11 +114,9 @@ let version = "6.4.0"; "--disable-libgomp" "--disable-libquadmath" "--disable-shared" - "--disable-libatomic" # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc - # maybe only needed on musl, PATH_MAX - # https://github.com/richfelker/musl-cross-make/blob/0867cdf300618d1e3e87a0a939fa4427207ad9d7/litecross/Makefile#L62 - "--disable-libmpx" + "--disable-libatomic" # requires libc + "--disable-decimal-float" # requires libc + "--disable-libmpx" # requires libc ] else [ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" else "--with-headers=${getDev libcCross}/include") diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 30c1611f5fb3..4dfbcf0f5458 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -77,6 +77,7 @@ let version = "7.3.0"; "--enable-sjlj-exceptions" "--enable-threads=win32" "--disable-win32-registry" + "--disable-libmpx" # requires libc ] else if crossStageStatic then [ "--disable-libssp" "--disable-nls" @@ -85,11 +86,9 @@ let version = "7.3.0"; "--disable-libgomp" "--disable-libquadmath" "--disable-shared" - "--disable-libatomic" # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc - # maybe only needed on musl, PATH_MAX - # https://github.com/richfelker/musl-cross-make/blob/0867cdf300618d1e3e87a0a939fa4427207ad9d7/litecross/Makefile#L62 - "--disable-libmpx" + "--disable-libatomic" # requires libc + "--disable-decimal-float" # requires libc + "--disable-libmpx" # requires libc ] else [ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" else "--with-headers=${getDev libcCross}/include") diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index 727cd9cbdbd7..04054df8bf82 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -72,6 +72,7 @@ let version = "8.2.0"; "--enable-sjlj-exceptions" "--enable-threads=win32" "--disable-win32-registry" + "--disable-libmpx" # requires libc ] else if crossStageStatic then [ "--disable-libssp" "--disable-nls" @@ -80,11 +81,9 @@ let version = "8.2.0"; "--disable-libgomp" "--disable-libquadmath" "--disable-shared" - "--disable-libatomic" # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc - # maybe only needed on musl, PATH_MAX - # https://github.com/richfelker/musl-cross-make/blob/0867cdf300618d1e3e87a0a939fa4427207ad9d7/litecross/Makefile#L62 - "--disable-libmpx" + "--disable-libatomic" # requires libc + "--disable-decimal-float" # requires libc + "--disable-libmpx" # requires libc ] else [ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" else "--with-headers=${getDev libcCross}/include") diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index dd6de818117f..230409e97538 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -69,6 +69,7 @@ let version = "7-20170409"; "--enable-sjlj-exceptions" "--enable-threads=win32" "--disable-win32-registry" + "--disable-libmpx" # requires libc ] else if crossStageStatic then [ "--disable-libssp" "--disable-nls" @@ -77,8 +78,9 @@ let version = "7-20170409"; "--disable-libgomp" "--disable-libquadmath" "--disable-shared" - "--disable-libatomic" # libatomic requires libc - "--disable-decimal-float" # libdecnumber requires libc + "--disable-libatomic" # requires libc + "--disable-decimal-float" # requires libc + "--disable-libmpx" # requires libc ] else [ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" else "--with-headers=${getDev libcCross}/include") diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix index c74c27598ee0..8b17ff9e5585 100644 --- a/pkgs/development/libraries/glibc/default.nix +++ b/pkgs/development/libraries/glibc/default.nix @@ -94,8 +94,7 @@ callPackage ./common.nix { inherit stdenv; } { mv $bin/bin/getconf_ $bin/bin/getconf ''; - # Hack to get around eval issue. - separateDebugInfo = !stdenv.isDarwin; + separateDebugInfo = true; meta.description = "The GNU C Library"; } diff --git a/pkgs/stdenv/cross/default.nix b/pkgs/stdenv/cross/default.nix index 31ca9f2c82e4..daa9f66615c9 100644 --- a/pkgs/stdenv/cross/default.nix +++ b/pkgs/stdenv/cross/default.nix @@ -53,12 +53,15 @@ in lib.init bootStages ++ [ else buildPackages.gcc; extraNativeBuildInputs = old.extraNativeBuildInputs + ++ lib.optionals + (hostPlatform.isLinux && !buildPlatform.isLinux) + [ buildPackages.patchelf buildPackages.paxctl ] + ++ lib.optional + (let f = p: !p.isx86 || p.libc == "musl"; in f hostPlatform && !(f buildPlatform)) + buildPackages.updateAutotoolsGnuConfigScriptsHook # without proper `file` command, libtool sometimes fails # to recognize 64-bit DLLs ++ lib.optional (hostPlatform.config == "x86_64-w64-mingw32") buildPackages.file - ++ lib.optional - (hostPlatform.isAarch64 || hostPlatform.isMips || hostPlatform.libc == "musl") - buildPackages.updateAutotoolsGnuConfigScriptsHook ; }); }) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index e1ce3200e8c9..c663c3743ed6 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -83,9 +83,7 @@ rec { doCheck' = doCheck && stdenv.hostPlatform == stdenv.buildPlatform; doInstallCheck' = doInstallCheck && stdenv.hostPlatform == stdenv.buildPlatform; - outputs' = - outputs ++ - (if separateDebugInfo then assert stdenv.hostPlatform.isLinux; [ "debug" ] else []); + outputs' = outputs ++ lib.optional separateDebugInfo "debug"; fixedOutputDrv = attrs ? outputHash; noNonNativeDeps = builtins.length (depsBuildTarget ++ depsBuildTargetPropagated @@ -176,7 +174,7 @@ rec { // { # A hack to make `nix-env -qa` and `nix search` ignore broken packages. # TODO(@oxij): remove this assert when something like NixOS/nix#1771 gets merged into nix. - name = assert validity.handled; name + lib.optionalString + name = assert validity.handled && (separateDebugInfo -> stdenv.hostPlatform.isLinux); name + lib.optionalString # Fixed-output derivations like source tarballs shouldn't get a host # suffix. But we have some weird ones with run-time deps that are # just used for their side-affects. Those might as well since the diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index b29a96314d2c..08703b6934e5 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -251,7 +251,8 @@ in }; extraNativeBuildInputs = [ prevStage.patchelf prevStage.paxctl ] ++ # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64. - lib.optional (!localSystem.isx86) prevStage.updateAutotoolsGnuConfigScriptsHook; + lib.optional (!localSystem.isx86 || localSystem.libc == "musl") + prevStage.updateAutotoolsGnuConfigScriptsHook; }) @@ -292,7 +293,8 @@ in }; extraNativeBuildInputs = [ prevStage.patchelf prevStage.xz ] ++ # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64. - lib.optional (!localSystem.isx86) prevStage.updateAutotoolsGnuConfigScriptsHook; + lib.optional (!localSystem.isx86 || localSystem.libc == "musl") + prevStage.updateAutotoolsGnuConfigScriptsHook; }) # Construct the final stdenv. It uses the Glibc and GCC, and adds @@ -324,7 +326,8 @@ in extraNativeBuildInputs = [ prevStage.patchelf prevStage.paxctl ] ++ # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64. - lib.optional (!localSystem.isx86) prevStage.updateAutotoolsGnuConfigScriptsHook; + lib.optional (!localSystem.isx86 || localSystem.libc == "musl") + prevStage.updateAutotoolsGnuConfigScriptsHook; cc = prevStage.gcc; @@ -357,7 +360,7 @@ in ++ [ /*propagated from .dev*/ linuxHeaders binutils gcc gcc.cc gcc.cc.lib gcc.expand-response-params ] - ++ lib.optionals (!localSystem.isx86) + ++ lib.optionals (!localSystem.isx86 || localSystem.libc == "musl") [ prevStage.updateAutotoolsGnuConfigScriptsHook prevStage.gnu-config ]; overrides = self: super: { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0b995e561f2d..07133473b808 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6509,7 +6509,6 @@ with pkgs; libcCross1 = if stdenv.targetPlatform.libc == "msvcrt" then targetPackages.windows.mingw_w64_headers else if stdenv.targetPlatform.libc == "libSystem" then darwin.xcode - else if stdenv.targetPlatform.libc == "musl" then musl else null; binutils1 = wrapBintoolsWith { bintools = binutils-unwrapped;