about summary refs log tree commit diff
path: root/pkgs/development/compilers/rust
diff options
context:
space:
mode:
authorWinter <winter@winter.cafe>2023-01-04 18:15:20 -0500
committerWinter <winter@winter.cafe>2023-01-04 18:15:20 -0500
commit8442601c6445894b350e8b2b10717c1f609bedaf (patch)
tree64e91fa74b1ce7e9e9a2e7214dcba06ea1897fb2 /pkgs/development/compilers/rust
parentccb3146bf27b954399648f7d12c3af8efeab1f13 (diff)
downloadnixlib-8442601c6445894b350e8b2b10717c1f609bedaf.tar
nixlib-8442601c6445894b350e8b2b10717c1f609bedaf.tar.gz
nixlib-8442601c6445894b350e8b2b10717c1f609bedaf.tar.bz2
nixlib-8442601c6445894b350e8b2b10717c1f609bedaf.tar.lz
nixlib-8442601c6445894b350e8b2b10717c1f609bedaf.tar.xz
nixlib-8442601c6445894b350e8b2b10717c1f609bedaf.tar.zst
nixlib-8442601c6445894b350e8b2b10717c1f609bedaf.zip
rust: fix on aarch64-linux by using GCC 11 and passing `-lgcc`
This change switches to using GCC 11 by default on aarch64-linux, as well as passing `-lgcc` to the linker, per #201485.

See #201254 and #208412 for wider context on the issue.
Diffstat (limited to 'pkgs/development/compilers/rust')
-rw-r--r--pkgs/development/compilers/rust/rustc.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix
index 43d603923c97..64254d502529 100644
--- a/pkgs/development/compilers/rust/rustc.nix
+++ b/pkgs/development/compilers/rust/rustc.nix
@@ -52,7 +52,9 @@ in stdenv.mkDerivation rec {
        # when linking stage1 libstd: cc: undefined reference to `__cxa_begin_catch'
        optional (stdenv.isLinux && !withBundledLLVM) "--push-state --as-needed -lstdc++ --pop-state"
     ++ optional (stdenv.isDarwin && !withBundledLLVM) "-lc++"
-    ++ optional stdenv.isDarwin "-rpath ${llvmSharedForHost}/lib");
+    ++ optional stdenv.isDarwin "-rpath ${llvmSharedForHost}/lib"
+       # https://github.com/NixOS/nixpkgs/issues/201254
+    ++ optional (stdenv.isLinux && stdenv.isAarch64 && stdenv.cc.isGNU) "-lgcc");
 
   # Increase codegen units to introduce parallelism within the compiler.
   RUSTFLAGS = "-Ccodegen-units=10";