3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #66617 from transumption-unstable/201908/rust-aarch64-linux-musl

buildRustPackage: fix cross-compilation to aarch64-unknown-linux-musl
This commit is contained in:
Yegor Timoshenko 2019-09-19 01:21:55 +00:00 committed by GitHub
commit 17a6ae03cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,6 +86,10 @@ stdenv.mkDerivation (args // {
${stdenv.lib.optionalString (stdenv.buildPlatform.config != stdenv.hostPlatform.config) ''
[target."${rustHostConfig}"]
"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