Skip to content

Commit 112d13c

Browse files
committed
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.)
1 parent b372f5a commit 112d13c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pkgs/build-support/rust/hooks/default.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@
109109
lib.optionalString (stdenv.hostPlatform.config != stdenv.targetPlatform.config) ''
110110
[target."${stdenv.targetPlatform.rust.rustcTarget}"]
111111
"linker" = "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"
112+
"rustflags" = [ "-C", "target-feature=${
113+
if pkgsTargetTarget.stdenv.targetPlatform.isStatic then "+" else "-"
114+
}crt-static" ]
112115
''
113116
+ ''
114117
[target."${stdenv.hostPlatform.rust.rustcTarget}"]
115118
"linker" = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
116-
"rustflags" = [ "-C", "target-feature=${
117-
if pkgsTargetTarget.stdenv.targetPlatform.isStatic then "+" else "-"
118-
}crt-static" ]
119119
'';
120120
};
121121
passthru.tests =

0 commit comments

Comments
 (0)