From eebd455dc0bcc9f0d4fc8372811611ba3af18bcd Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 6 May 2018 14:59:50 -0400 Subject: [PATCH 1/3] linux stdenv: Update gnu-config on all non-x86 Not just Aarch64. Other non-x86 platforms might be old enough, but I am about to update gnu-config to handle things better across the board. --- pkgs/stdenv/linux/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 9e19d199a5d..63b4c8ecc24 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -255,7 +255,7 @@ in }; extraNativeBuildInputs = [ prevStage.patchelf prevStage.paxctl ] ++ # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64. - lib.optional localSystem.isAarch64 prevStage.updateAutotoolsGnuConfigScriptsHook; + lib.optional (!localSystem.isx86) prevStage.updateAutotoolsGnuConfigScriptsHook; }) @@ -297,7 +297,7 @@ in }; extraNativeBuildInputs = [ prevStage.patchelf prevStage.xz ] ++ # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64. - lib.optional localSystem.isAarch64 prevStage.updateAutotoolsGnuConfigScriptsHook; + lib.optional (!localSystem.isx86) prevStage.updateAutotoolsGnuConfigScriptsHook; }) # Construct the final stdenv. It uses the Glibc and GCC, and adds @@ -327,7 +327,7 @@ in extraNativeBuildInputs = [ prevStage.patchelf prevStage.paxctl ] ++ # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64. - lib.optional localSystem.isAarch64 prevStage.updateAutotoolsGnuConfigScriptsHook; + lib.optional (!localSystem.isx86) prevStage.updateAutotoolsGnuConfigScriptsHook; cc = prevStage.gcc; @@ -361,7 +361,7 @@ in binutils gcc gcc.cc gcc.cc.lib gcc.expand-response-params ] ++ lib.optional (localSystem.libc == "musl") libiconv - ++ lib.optionals localSystem.isAarch64 + ++ lib.optionals (!localSystem.isx86) [ prevStage.updateAutotoolsGnuConfigScriptsHook prevStage.gnu-config ]; overrides = self: super: { From 29db8170036d3e6a04ad6d77c62ec1050e50f6fb Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 6 May 2018 15:07:04 -0400 Subject: [PATCH 2/3] gnu-config: Update to support ARM and 4 quardruples I recently upstreamed - https://git.savannah.gnu.org/cgit/config.git/commit/?id=50a0413a5ba9684aa9247444c60a5cea47c4435d - https://git.savannah.gnu.org/cgit/config.git/commit/?id=09df750b994963a47f7c450f74b7e3f8567a6355 --- pkgs/development/libraries/gnu-config/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/gnu-config/default.nix b/pkgs/development/libraries/gnu-config/default.nix index b46523071c7..a14d7486e96 100644 --- a/pkgs/development/libraries/gnu-config/default.nix +++ b/pkgs/development/libraries/gnu-config/default.nix @@ -1,16 +1,16 @@ { stdenv, fetchurl }: let - rev = "6a82322dd05cdc57b4cd9f7effdf1e2fd6f7482b"; + rev = "b75cdc942a6172f63b34faf642b8c797239f6776"; # Don't use fetchgit as this is needed during Aarch64 bootstrapping configGuess = fetchurl { url = "http://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=${rev}"; - sha256 = "1yj9yi94h7z4z6jzickddv64ksz1aq5kj0c7krgzjn8xf8p3avmh"; + sha256 = "1bb8z1wzjs81p9qrvji4bc2a8zyxjinz90k8xq7sxxdp6zrmq1sv"; }; configSub = fetchurl { url = "http://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=${rev}"; - sha256 = "1qsqdpla6icbzskkk7v3zxrpzlpqlc94ny9hyy5wh5lm5rwwfvb7"; + sha256 = "00dn5i2cp4iqap5vr368r5ifrgcjfq5pr97i4dkkdbha1han5hsc"; }; in stdenv.mkDerivation rec { From f472dd7652c22a848670b419b9d8d45ee174dd48 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 26 Apr 2018 20:20:37 -0400 Subject: [PATCH 3/3] Revert "Revert "gcc, binutils: Get rid of 32-bit ARM configure flag exception"" And there's more reverts too. The previous commmit d838afbc9376bdadb8c690eb00b425f3eeccdf2d to gnu-config finally solves it! This reverts commit 3ed545ab31146e607c57649936c75869d6aa9ba2. --- 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(-) diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 36b48b88021..0482ff772d6 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -240,11 +240,7 @@ stdenv.mkDerivation ({ ; # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = - # TODO(@Ericson2314): Figure out what's going wrong with Arm - if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isAarch32 - 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 dea8b912b27..06068386070 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -282,11 +282,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 buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isAarch32 - 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 343d820fa23..1fab985473e 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -291,11 +291,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 buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isAarch32 - 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 0d9565de0a7..6e3e7d0b099 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -311,11 +311,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 buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isAarch32 - 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 29f2bad7eac..67b7cf61c5a 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -315,11 +315,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 buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isAarch32 - 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 e75e22efce1..2a034954f73 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -311,11 +311,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 buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isAarch32 - 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 609d418693d..693474bfb5e 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -283,11 +283,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 buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isAarch32 - 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 549eaf5253d..31c86c785c2 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 buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isAarch32 - 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"