diff options
author | Tuomas Tynkkynen <tuomas@tuxera.com> | 2016-02-05 00:47:23 +0200 |
---|---|---|
committer | Tuomas Tynkkynen <tuomas@tuxera.com> | 2017-01-25 00:01:51 +0200 |
commit | 7c8a060c09799eb2ee70c00aa695ff08e5f07c6f (patch) | |
tree | d346e6bc9c7b2bf20d8c2240a66a2ff91fdaedfc | |
parent | 41fd1ed90346a3d7f6b067301ac9e147ef4dcd5e (diff) | |
download | nixpkgs-7c8a060c09799eb2ee70c00aa695ff08e5f07c6f.tar nixpkgs-7c8a060c09799eb2ee70c00aa695ff08e5f07c6f.tar.gz nixpkgs-7c8a060c09799eb2ee70c00aa695ff08e5f07c6f.tar.bz2 nixpkgs-7c8a060c09799eb2ee70c00aa695ff08e5f07c6f.tar.lz nixpkgs-7c8a060c09799eb2ee70c00aa695ff08e5f07c6f.tar.xz nixpkgs-7c8a060c09799eb2ee70c00aa695ff08e5f07c6f.tar.zst nixpkgs-7c8a060c09799eb2ee70c00aa695ff08e5f07c6f.zip |
stdenv: Bringup aarch64 architecture support
-rw-r--r-- | lib/platforms.nix | 2 | ||||
-rw-r--r-- | pkgs/build-support/cc-wrapper/default.nix | 1 | ||||
-rw-r--r-- | pkgs/stdenv/default.nix | 1 | ||||
-rw-r--r-- | pkgs/stdenv/generic/default.nix | 2 | ||||
-rw-r--r-- | pkgs/stdenv/linux/default.nix | 1 | ||||
-rw-r--r-- | pkgs/stdenv/linux/make-bootstrap-tools-cross.nix | 16 | ||||
-rw-r--r-- | pkgs/top-level/platforms.nix | 17 |
7 files changed, 38 insertions, 2 deletions
diff --git a/lib/platforms.nix b/lib/platforms.nix index b068d080e75..0cd9485d4cc 100644 --- a/lib/platforms.nix +++ b/lib/platforms.nix @@ -15,7 +15,7 @@ rec { freebsd = ["i686-freebsd" "x86_64-freebsd"]; gnu = linux; /* ++ hurd ++ kfreebsd ++ ... */ illumos = ["x86_64-solaris"]; - linux = ["i686-linux" "x86_64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "mips64el-linux"]; + linux = ["i686-linux" "x86_64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux" "mips64el-linux"]; netbsd = ["i686-netbsd" "x86_64-netbsd"]; openbsd = ["i686-openbsd" "x86_64-openbsd"]; unix = linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos; diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 95e0b360937..95c6bee3cc7 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -272,6 +272,7 @@ stdenv.mkDerivation { if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else # ARM with a wildcard, which can be "" or "-armhf". if stdenv.isArm then "ld-linux*.so.3" else + if stdenv.system == "aarch64-linux" then "ld-linux-aarch64.so.1" else if stdenv.system == "powerpc-linux" then "ld.so.1" else if stdenv.system == "mips64el-linux" then "ld.so.1" else if stdenv.system == "x86_64-darwin" then "/usr/lib/dyld" else diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index 78dbde13b89..098caca0d89 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 269d7ef893a..2010e35f58a 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/default.nix b/pkgs/stdenv/linux/default.nix index 611628b35ab..41695b5c36b 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") diff --git a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix index 38b3e611bc2..9cce27ba5b6 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; pkgsUnspliced = pkgsFun ({inherit system;} // selectedCrossSystem); pkgs = pkgsUnspliced.splicedPackages; @@ -265,4 +278,5 @@ rec { armv5tel = buildFor "armv5tel"; armv6l = buildFor "armv6l"; armv7l = buildFor "armv7l"; + aarch64 = buildFor "aarch64"; } diff --git a/pkgs/top-level/platforms.nix b/pkgs/top-level/platforms.nix index e6c55241b35..c740fbe6f8d 100644 --- a/pkgs/top-level/platforms.nix +++ b/pkgs/top-level/platforms.nix @@ -443,12 +443,29 @@ rec { }; }; + aarch64-multiplatform = { + name = "aarch64-multiplatform"; + kernelMajor = "2.6"; # Using "2.6" enables 2.6 kernel syscalls in glibc. + kernelHeadersBaseConfig = "defconfig"; + kernelBaseConfig = "defconfig"; + kernelArch = "arm64"; + kernelDTB = true; + kernelAutoModules = false; + kernelExtraConfig = ""; + uboot = null; + kernelTarget = "Image"; + gcc = { + arch = "armv8-a"; + }; + }; + selectPlatformBySystem = system: { "i686-linux" = pc32; "x86_64-linux" = pc64; "armv5tel-linux" = sheevaplug; "armv6l-linux" = raspberrypi; "armv7l-linux" = armv7l-hf-multiplatform; + "aarch64-linux" = aarch64-multiplatform; "mips64el-linux" = fuloong2f_n32; }.${system} or pcBase; } |