cargoSetupHook: fix setting crt-static
As is retrospectively obvious from the fact that it was looking at pkgsTargetTarget, this should have been in the section for the target, not the host. This fixes e.g. pkgsStatic.xq for 64-bit RISC-V. (For platforms other than 64-bit RISC-V this being wrong was masked by the musl Rust targets being static by default.)
This commit is contained in:
@@ -109,13 +109,13 @@
|
||||
lib.optionalString (stdenv.hostPlatform.config != stdenv.targetPlatform.config) ''
|
||||
[target."${stdenv.targetPlatform.rust.rustcTarget}"]
|
||||
"linker" = "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"
|
||||
"rustflags" = [ "-C", "target-feature=${
|
||||
if pkgsTargetTarget.stdenv.targetPlatform.isStatic then "+" else "-"
|
||||
}crt-static" ]
|
||||
''
|
||||
+ ''
|
||||
[target."${stdenv.hostPlatform.rust.rustcTarget}"]
|
||||
"linker" = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
|
||||
"rustflags" = [ "-C", "target-feature=${
|
||||
if pkgsTargetTarget.stdenv.targetPlatform.isStatic then "+" else "-"
|
||||
}crt-static" ]
|
||||
'';
|
||||
};
|
||||
passthru.tests =
|
||||
|
||||
Reference in New Issue
Block a user