summary refs log tree commit diff
path: root/pkgs/build-support/rust
diff options
context:
space:
mode:
authorYegor Timoshenko <yegortimoshenko@transumption.com>2019-08-14 11:59:41 +0000
committerYegor Timoshenko <yegortimoshenko@transumption.com>2019-09-12 09:00:17 +0000
commit08b73c1d587305d471f8214ce63baf0f7b00233f (patch)
tree939b4a71160365c4776e54e71b6f9e3f2aead5a1 /pkgs/build-support/rust
parentddf15d321f6679f82f34797533402b3ffd139352 (diff)
downloadnixpkgs-08b73c1d587305d471f8214ce63baf0f7b00233f.tar
nixpkgs-08b73c1d587305d471f8214ce63baf0f7b00233f.tar.gz
nixpkgs-08b73c1d587305d471f8214ce63baf0f7b00233f.tar.bz2
nixpkgs-08b73c1d587305d471f8214ce63baf0f7b00233f.tar.lz
nixpkgs-08b73c1d587305d471f8214ce63baf0f7b00233f.tar.xz
nixpkgs-08b73c1d587305d471f8214ce63baf0f7b00233f.tar.zst
nixpkgs-08b73c1d587305d471f8214ce63baf0f7b00233f.zip
buildRustPackage: fix cross-compilation to aarch64-unknown-linux-musl
Diffstat (limited to 'pkgs/build-support/rust')
-rw-r--r--pkgs/build-support/rust/default.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix
index 6afe93c7e4c..1eea6b95d34 100644
--- a/pkgs/build-support/rust/default.nix
+++ b/pkgs/build-support/rust/default.nix
@@ -86,6 +86,10 @@ in stdenv.mkDerivation (args // {
     ${stdenv.lib.optionalString (stdenv.buildPlatform.config != stdenv.hostPlatform.config) ''
     [target."${stdenv.hostPlatform.config}"]
     "linker" = "${ccForHost}"
+    ${# https://github.com/rust-lang/rust/issues/46651#issuecomment-433611633
+      stdenv.lib.optionalString (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isAarch64) ''
+    "rustflags" = [ "-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc" ]
+    ''}
     ''}
     EOF
     cat .cargo/config