From f2bb59e710a4805653266833fa80940e600f3ecf Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 11 Sep 2018 12:47:09 -0400 Subject: [PATCH] stdenv linux, stdenv cross: Harmonize extraNativeBuildInputs Want to make sure these are the same per host platform, without duplication. --- pkgs/stdenv/cross/default.nix | 9 ++++++--- pkgs/stdenv/linux/default.nix | 11 +++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) 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/linux/default.nix b/pkgs/stdenv/linux/default.nix index de58178a34ba..884730cfe904 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: {