Skip to content

Commit

Permalink
buildRustPackage: fix cross-compilation to aarch64-unknown-linux-musl
Browse files Browse the repository at this point in the history
(cherry picked from commit 08b73c1)
  • Loading branch information
lukateras authored and dtzWill committed Oct 23, 2019
1 parent 909ceb3 commit 293ae95
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgs/build-support/rust/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 293ae95

Please sign in to comment.