Skip to content

Commit 5283243

Browse files
committed
Inline crt-static choice for pc-windows-msvc
This avoids the possibility of a duplicate or conflicting crt-static command line option sent to rustc.
1 parent 4b09dc6 commit 5283243

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/bootstrap/bin/rustc.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,6 @@ fn main() {
237237
}
238238
}
239239

240-
if target.contains("pc-windows-msvc") {
241-
cmd.arg("-Z").arg("unstable-options");
242-
cmd.arg("-C").arg("target-feature=+crt-static");
243-
}
244-
245240
if let Ok(s) = env::var("RUSTC_CRT_STATIC") {
246241
if s == "true" {
247242
cmd.arg("-C").arg("target-feature=+crt-static");

src/bootstrap/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,8 +658,12 @@ impl Build {
658658

659659
/// Returns if this target should statically link the C runtime, if specified
660660
fn crt_static(&self, target: Interned<String>) -> Option<bool> {
661-
self.config.target_config.get(&target)
662-
.and_then(|t| t.crt_static)
661+
if target.contains("pc-windows-msvc") {
662+
Some(true)
663+
} else {
664+
self.config.target_config.get(&target)
665+
.and_then(|t| t.crt_static)
666+
}
663667
}
664668

665669
/// Returns the "musl root" for this `target`, if defined

0 commit comments

Comments
 (0)