diff options
author | Tuomas Tynkkynen <tuomas@tuxera.com> | 2016-03-05 02:28:23 +0200 |
---|---|---|
committer | Tuomas Tynkkynen <tuomas@tuxera.com> | 2017-01-25 00:01:52 +0200 |
commit | c909f1b18e9c5deecdfe6d46c7e9901fe3e6cf83 (patch) | |
tree | dae9070347f134502f6897a9544cb235162c56d0 /pkgs/stdenv | |
parent | 6e46dbf8e7c2362aab5823207c27c6d7e3870f11 (diff) | |
download | nixpkgs-c909f1b18e9c5deecdfe6d46c7e9901fe3e6cf83.tar nixpkgs-c909f1b18e9c5deecdfe6d46c7e9901fe3e6cf83.tar.gz nixpkgs-c909f1b18e9c5deecdfe6d46c7e9901fe3e6cf83.tar.bz2 nixpkgs-c909f1b18e9c5deecdfe6d46c7e9901fe3e6cf83.tar.lz nixpkgs-c909f1b18e9c5deecdfe6d46c7e9901fe3e6cf83.tar.xz nixpkgs-c909f1b18e9c5deecdfe6d46c7e9901fe3e6cf83.tar.zst nixpkgs-c909f1b18e9c5deecdfe6d46c7e9901fe3e6cf83.zip |
stdenv: Add updateAutoconfGnuConfigScriptsHook for aarch64
This is required for Aarch64 since a lot of source tarballs ship with outdated configure scripts that don't recognize aarch64. Simply replacing the config.guess and config.sub with new versions from upstream makes them build again. This same approach is used by at least Buildroot and Fedora. In principle this could be enabled for all architectures but conditionalizing this on aarch64 avoids a mass rebuild on x86.
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/adapters.nix | 1 | ||||
-rw-r--r-- | pkgs/stdenv/linux/default.nix | 14 |
2 files changed, 11 insertions, 4 deletions
diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index 7e0eaeddd2c..90a55188f09 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -92,6 +92,7 @@ rec { # without proper `file` command, libtool sometimes fails # to recognize 64-bit DLLs ++ stdenv.lib.optional (cross.config == "x86_64-w64-mingw32") pkgs.file + ++ stdenv.lib.optional (cross.config == "aarch64-linux-gnu") pkgs.updateAutotoolsGnuConfigScriptsHook ; # Cross-linking dynamic libraries, every buildInput should diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 41695b5c36b..fe685a1e77c 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -214,7 +214,9 @@ in isl = isl_0_14; }; }; - extraBuildInputs = [ prevStage.patchelf prevStage.paxctl ]; + extraBuildInputs = [ prevStage.patchelf prevStage.paxctl ] ++ + # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64. + lib.optional (system == "aarch64-linux") prevStage.updateAutotoolsGnuConfigScriptsHook; }) @@ -241,7 +243,9 @@ in shell = self.bash + "/bin/bash"; }; }; - extraBuildInputs = [ prevStage.patchelf prevStage.xz ]; + extraBuildInputs = [ prevStage.patchelf prevStage.xz ] ++ + # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64. + lib.optional (system == "aarch64-linux") prevStage.updateAutotoolsGnuConfigScriptsHook; }) # Construct the final stdenv. It uses the Glibc and GCC, and adds @@ -269,7 +273,9 @@ in initialPath = ((import ../common-path.nix) {pkgs = prevStage;}); - extraBuildInputs = [ prevStage.patchelf prevStage.paxctl ]; + extraBuildInputs = [ prevStage.patchelf prevStage.paxctl ] ++ + # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64. + lib.optional (system == "aarch64-linux") prevStage.updateAutotoolsGnuConfigScriptsHook; cc = prevStage.gcc; @@ -288,7 +294,7 @@ in [ gzip bzip2 xz bash binutils coreutils diffutils findutils gawk glibc gnumake gnused gnutar gnugrep gnupatch patchelf attr acl paxctl zlib pcre linuxHeaders ed gcc gcc.cc libsigsegv - ]; + ] ++ lib.optional (system == "aarch64-linux") prevStage.updateAutotoolsGnuConfigScriptsHook; */ overrides = self: super: { |