summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2017-01-26 17:52:28 +0200
committerGitHub <noreply@github.com>2017-01-26 17:52:28 +0200
commite2a2f6d595d7df5ddeecbfed830692fd8ee68697 (patch)
tree10ffdaab98bac12bd6afd82c42d497d50667b04a /pkgs/stdenv
parentbca9bcb3c3dd3b2e46f8e07db9a8326de01697c7 (diff)
parent32643dc07db92ed989c496f23037138802927dea (diff)
downloadnixlib-e2a2f6d595d7df5ddeecbfed830692fd8ee68697.tar
nixlib-e2a2f6d595d7df5ddeecbfed830692fd8ee68697.tar.gz
nixlib-e2a2f6d595d7df5ddeecbfed830692fd8ee68697.tar.bz2
nixlib-e2a2f6d595d7df5ddeecbfed830692fd8ee68697.tar.lz
nixlib-e2a2f6d595d7df5ddeecbfed830692fd8ee68697.tar.xz
nixlib-e2a2f6d595d7df5ddeecbfed830692fd8ee68697.tar.zst
nixlib-e2a2f6d595d7df5ddeecbfed830692fd8ee68697.zip
Merge pull request #22117 from dezgeg/aarch64-for-merge
Aarch64 (ARM64) support
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/adapters.nix1
-rw-r--r--pkgs/stdenv/default.nix1
-rw-r--r--pkgs/stdenv/generic/default.nix2
-rw-r--r--pkgs/stdenv/linux/bootstrap-files/aarch64.nix11
-rw-r--r--pkgs/stdenv/linux/default.nix15
-rw-r--r--pkgs/stdenv/linux/make-bootstrap-tools-cross.nix16
-rw-r--r--pkgs/stdenv/linux/make-bootstrap-tools.nix5
7 files changed, 44 insertions, 7 deletions
diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix
index 7e0eaeddd2c4..90a55188f09e 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/default.nix b/pkgs/stdenv/default.nix
index 78dbde13b89d..098caca0d890 100644
--- a/pkgs/stdenv/default.nix
+++ b/pkgs/stdenv/default.nix
@@ -44,6 +44,7 @@ in
     "armv5tel-linux" = stagesLinux;
     "armv6l-linux" = stagesLinux;
     "armv7l-linux" = stagesLinux;
+    "aarch64-linux" = stagesLinux;
     "mips64el-linux" = stagesLinux;
     "powerpc-linux" = /* stagesLinux */ stagesNative;
     "x86_64-darwin" = stagesDarwin;
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index 269d7ef893a1..2010e35f58a3 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -311,6 +311,7 @@ let
              || system == "armv5tel-linux"
              || system == "armv6l-linux"
              || system == "armv7l-linux"
+             || system == "aarch64-linux"
              || system == "mips64el-linux";
       isGNU = system == "i686-gnu"; # GNU/Hurd
       isGlibc = isGNU # useful for `stdenvNative'
@@ -348,6 +349,7 @@ let
       isArm = system == "armv5tel-linux"
            || system == "armv6l-linux"
            || system == "armv7l-linux";
+      isAarch64 = system == "aarch64-linux";
       isBigEndian = system == "powerpc-linux";
 
       # Whether we should run paxctl to pax-mark binaries.
diff --git a/pkgs/stdenv/linux/bootstrap-files/aarch64.nix b/pkgs/stdenv/linux/bootstrap-files/aarch64.nix
new file mode 100644
index 000000000000..7f1acc83433b
--- /dev/null
+++ b/pkgs/stdenv/linux/bootstrap-files/aarch64.nix
@@ -0,0 +1,11 @@
+{
+  busybox = import <nix/fetchurl.nix> {
+    url = http://nixos-arm.dezgeg.me/bootstrap-aarch64-for-merge/busybox;
+    sha256 = "12qcml1l67skpjhfjwy7gr10nc86gqcwjmz9ggp7knss8gq8pv7f";
+    executable = true;
+  };
+  bootstrapTools = import <nix/fetchurl.nix> {
+    url = http://nixos-arm.dezgeg.me/bootstrap-aarch64-for-merge/bootstrap-tools.tar.xz;
+    sha256 = "10sqgh0dchp1906h06jznxh8gfflnzbpfy27hng2mmc1l0c7irjr";
+  };
+}
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index 611628b35aba..fe685a1e77ce 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -12,6 +12,7 @@
     "armv5tel-linux" = import ./bootstrap-files/armv5tel.nix;
     "armv6l-linux" = import ./bootstrap-files/armv6l.nix;
     "armv7l-linux" = import ./bootstrap-files/armv7l.nix;
+    "aarch64-linux" = import ./bootstrap-files/aarch64.nix;
     "mips64el-linux" = import ./bootstrap-files/loongson2f.nix;
   }.${localSystem.system}
     or (abort "unsupported platform for the pure Linux stdenv")
@@ -213,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;
   })
 
 
@@ -240,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
@@ -268,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;
 
@@ -287,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: {
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
index b5dfcb73a122..dda1f7e0b337 100644
--- a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
+++ b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
@@ -50,10 +50,23 @@ let
     };
   };
 
+  aarch64-multiplatform-crossSystem = {
+    crossSystem = rec {
+      config = "aarch64-linux-gnu";
+      bigEndian = false;
+      arch = "aarch64";
+      withTLS = true;
+      libc = "glibc";
+      platform = pkgsNoParams.platforms.aarch64-multiplatform;
+      inherit (platform) gcc;
+    };
+  };
+
   selectedCrossSystem =
     if toolsArch == "armv5tel" then sheevaplugCrossSystem else
     if toolsArch == "armv6l" then raspberrypiCrossSystem else
-    if toolsArch == "armv7l" then armv7l-hf-multiplatform-crossSystem else null;
+    if toolsArch == "armv7l" then armv7l-hf-multiplatform-crossSystem else
+    if toolsArch == "aarch64" then aarch64-multiplatform-crossSystem else null;
 
   pkgs = pkgsFun ({inherit system;} // selectedCrossSystem);
 
@@ -264,4 +277,5 @@ rec {
     armv5tel = buildFor "armv5tel";
     armv6l = buildFor "armv6l";
     armv7l = buildFor "armv7l";
+    aarch64 = buildFor "aarch64";
 }
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix
index d31253075c9d..2e7b24af131d 100644
--- a/pkgs/stdenv/linux/make-bootstrap-tools.nix
+++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix
@@ -170,8 +170,9 @@ rec {
   };
 
   bootstrapFiles = {
-    busybox = "${build}/on-server/busybox";
-    bootstrapTools = "${build}/on-server/bootstrap-tools.tar.xz";
+    # Make them their own store paths to test that busybox still works when the binary is named /nix/store/HASH-busybox
+    busybox = runCommand "busybox" {} "cp ${build}/on-server/busybox $out";
+    bootstrapTools = runCommand "bootstrap-tools.tar.xz" {} "cp ${build}/on-server/bootstrap-tools.tar.xz $out";
   };
 
   bootstrapTools = import ./bootstrap-tools { inherit system bootstrapFiles; };