Skip to content

Commit 55dab7c

Browse files
committed
bootstrap: pass crt-static for the compiler host as well
1 parent bcab14a commit 55dab7c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/bootstrap/bin/rustc.rs

+9
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,15 @@ fn main() {
268268
if let Ok(host_linker) = env::var("RUSTC_HOST_LINKER") {
269269
cmd.arg(format!("-Clinker={}", host_linker));
270270
}
271+
272+
if let Ok(s) = env::var("RUSTC_HOST_CRT_STATIC") {
273+
if s == "true" {
274+
cmd.arg("-C").arg("target-feature=+crt-static");
275+
}
276+
if s == "false" {
277+
cmd.arg("-C").arg("target-feature=-crt-static");
278+
}
279+
}
271280
}
272281

273282
if env::var_os("RUSTC_PARALLEL_QUERIES").is_some() {

src/bootstrap/builder.rs

+4
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,10 @@ impl<'a> Builder<'a> {
842842
cargo.env("RUSTC_CRT_STATIC", x.to_string());
843843
}
844844

845+
if let Some(x) = self.crt_static(compiler.host) {
846+
cargo.env("RUSTC_HOST_CRT_STATIC", x.to_string());
847+
}
848+
845849
// Enable usage of unstable features
846850
cargo.env("RUSTC_BOOTSTRAP", "1");
847851
self.add_rust_test_threads(&mut cargo);

0 commit comments

Comments
 (0)