diff options
author | Yegor Timoshenko <yegortimoshenko@transumption.com> | 2019-08-14 11:59:41 +0000 |
---|---|---|
committer | Yegor Timoshenko <yegortimoshenko@transumption.com> | 2019-09-12 09:00:17 +0000 |
commit | 08b73c1d587305d471f8214ce63baf0f7b00233f (patch) | |
tree | 939b4a71160365c4776e54e71b6f9e3f2aead5a1 /pkgs/build-support | |
parent | ddf15d321f6679f82f34797533402b3ffd139352 (diff) | |
download | nixlib-08b73c1d587305d471f8214ce63baf0f7b00233f.tar nixlib-08b73c1d587305d471f8214ce63baf0f7b00233f.tar.gz nixlib-08b73c1d587305d471f8214ce63baf0f7b00233f.tar.bz2 nixlib-08b73c1d587305d471f8214ce63baf0f7b00233f.tar.lz nixlib-08b73c1d587305d471f8214ce63baf0f7b00233f.tar.xz nixlib-08b73c1d587305d471f8214ce63baf0f7b00233f.tar.zst nixlib-08b73c1d587305d471f8214ce63baf0f7b00233f.zip |
buildRustPackage: fix cross-compilation to aarch64-unknown-linux-musl
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/rust/default.nix | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix index 6afe93c7e4c1..1eea6b95d349 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 |