buildRustPackage: fix cross-compilation to aarch64-unknown-linux-musl
commit08b73c1d587305d471f8214ce63baf0f7b00233f
authorYegor Timoshenko <yegortimoshenko@transumption.com>
dateWed 14 Aug 2019, 11:59 (7 years ago)
parentddf15d3
pkgs/build-support/rust/default.nix+4
@@ -86,6 +86,10 @@ in stdenv.mkDerivation (args // {
8686 ${stdenv.lib.optionalString (stdenv.buildPlatform.config != stdenv.hostPlatform.config) ''
8787 [target."${stdenv.hostPlatform.config}"]
8888 "linker" = "${ccForHost}"
89+ ${# https://github.com/rust-lang/rust/issues/46651#issuecomment-433611633
90+ stdenv.lib.optionalString (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isAarch64) ''
91+ "rustflags" = [ "-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc" ]
92+ ''}
8993 ''}
9094 EOF
9195 cat .cargo/config