mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
rustPlatform.cargoSetupHook: fix platform check (#260068)
Cargo will never need to link for the target platform — that'd be for
the package being built to do at runtime. Cargo should know about the
build and host linkers.
This fixes e.g. pkgsCross.musl64.fd from x86_64-linux.
Fixes: 67a4f828b4
("rust: hooks: fix cross compilation")
This commit is contained in:
parent
b8d473b6d2
commit
7262026f0f
@ -67,9 +67,9 @@
|
||||
cargoConfig = ''
|
||||
[target."${rust.toRustTarget stdenv.buildPlatform}"]
|
||||
"linker" = "${rust.envVars.ccForBuild}"
|
||||
${lib.optionalString (stdenv.hostPlatform.config != stdenv.targetPlatform.config) ''
|
||||
[target."${rust.toRustTarget stdenv.targetPlatform}"]
|
||||
"linker" = "${rust.envVars.ccForTarget}"
|
||||
${lib.optionalString (stdenv.buildPlatform.config != stdenv.hostPlatform.config) ''
|
||||
[target."${rust.toRustTarget stdenv.hostPlatform}"]
|
||||
"linker" = "${rust.envVars.ccForHost}"
|
||||
''}
|
||||
"rustflags" = [ "-C", "target-feature=${if stdenv.hostPlatform.isStatic then "+" else "-"}crt-static" ]
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user