diff --git a/pkgs/development/compilers/rust/bootstrap.nix b/pkgs/development/compilers/rust/bootstrap.nix index da9680943b5..a707fe2e69e 100644 --- a/pkgs/development/compilers/rust/bootstrap.nix +++ b/pkgs/development/compilers/rust/bootstrap.nix @@ -9,6 +9,7 @@ let hashes = { i686-unknown-linux-gnu = "abe592e06616cdc2fcca56ddbe482050dd49a1fada35e2af031c64fe6eb14668"; x86_64-unknown-linux-gnu = "ca1cf3aed73ff03d065a7d3e57ecca92228d35dc36d9274a6597441319f18eb8"; + aarch64-unknown-linux-gnu = "eaab3df489d4d8f976c4327d812b9870730eed6d0bbd52712767083d02be7472"; i686-apple-darwin = "b3c2470f8f132d285e6c989681e251592b67071bc9d93cac8a2e6b66f7bdfcb5"; x86_64-apple-darwin = "fa1fb8896d5e327cbe6deeb50e6e9a3346de629f2e6bcbd8c10f19f3e2ed67d5"; }; @@ -18,6 +19,8 @@ let then "i686-unknown-linux-gnu" else if stdenv.system == "x86_64-linux" then "x86_64-unknown-linux-gnu" + else if stdenv.system == "aarch64-linux" + then "aarch64-unknown-linux-gnu" else if stdenv.system == "i686-darwin" then "i686-apple-darwin" else if stdenv.system == "x86_64-darwin" diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix index 3973eaff187..76dafd95353 100644 --- a/pkgs/development/compilers/rust/default.nix +++ b/pkgs/development/compilers/rust/default.nix @@ -23,7 +23,9 @@ rec { patches = [ ./patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch - ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch; + ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch + # https://github.com/rust-lang/rust/issues/45410 + ++ stdenv.lib.optional stdenv.isAarch64 ./patches/aarch64-disable-test_loading_cosine.patch; }; diff --git a/pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch b/pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch new file mode 100644 index 00000000000..d29eb16cfe5 --- /dev/null +++ b/pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch @@ -0,0 +1,12 @@ +diff --git a/src/librustc_back/dynamic_lib.rs b/src/librustc_back/dynamic_lib.rs +index 1b42fa0..92256dc 100644 +--- a/src/librustc_back/dynamic_lib.rs ++++ b/src/librustc_back/dynamic_lib.rs +@@ -80,6 +80,7 @@ mod tests { + use std::mem; + + #[test] ++ #[ignore] + fn test_loading_cosine() { + if cfg!(windows) { + return diff --git a/pkgs/development/compilers/rust/print-hashes.sh b/pkgs/development/compilers/rust/print-hashes.sh index f3d094d65a8..dc7e3719355 100755 --- a/pkgs/development/compilers/rust/print-hashes.sh +++ b/pkgs/development/compilers/rust/print-hashes.sh @@ -10,6 +10,7 @@ set -euo pipefail PLATFORMS=( i686-unknown-linux-gnu x86_64-unknown-linux-gnu + aarch64-unknown-linux-gnu i686-apple-darwin x86_64-apple-darwin ) diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index 4d92566edd4..ec0f100fb56 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -34,6 +34,9 @@ stdenv.mkDerivation { __darwinAllowLocalNetworking = true; + # The build will fail at the very end on AArch64 without this. + dontUpdateAutotoolsGnuConfigScripts = if stdenv.isAarch64 then true else null; + NIX_LDFLAGS = optionalString stdenv.isDarwin "-rpath ${llvmShared}/lib"; # Enable nightly features in stable compiles (used for