Merge pull request #22117 from dezgeg/aarch64-for-merge
Aarch64 (ARM64) support
This commit is contained in:
11
pkgs/stdenv/linux/bootstrap-files/aarch64.nix
Normal file
11
pkgs/stdenv/linux/bootstrap-files/aarch64.nix
Normal file
@@ -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";
|
||||
};
|
||||
}
|
||||
@@ -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: {
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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; };
|
||||
|
||||
Reference in New Issue
Block a user