Skip to content

Commit 3847786

Browse files
committed
bootstrap: Don't force -static for musl targets in cc-rs
I can't really make sense of this part. For musl targets that default to static linkage, crt-static is set as a target feature and cc-rs should be able to correctly infer that -static should be used. However, you cannot compile rustc or run the tests with +crt-static, so you'd have to disable it in bootstrap.toml anyways, bypassing this codepath entirely. But for targets that are defaulting to dynamic linkage, hardcoding -static for all musl targets in cc_detect just doesn't make sense. It breaks the run-make tests because the compiler defaults (and is configured!) to dynamically link dylibs, but the cc-rs configuration is hardcoded to link them statically, which will fail. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
1 parent d1ed52b commit 3847786

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/bootstrap/src/utils/cc_detect.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ fn new_cc_build(build: &Build, target: TargetSelection) -> cc::Build {
4848
if target.is_msvc() {
4949
cfg.static_crt(true);
5050
}
51-
if target.contains("musl") {
52-
cfg.static_flag(true);
53-
}
5451
}
5552
}
5653
cfg

0 commit comments

Comments
 (0)