Skip to content

Commit ec2b861

Browse files
committed
bootstrap: pass crt-static for the compiler host as well
1 parent 5ecf29d commit ec2b861

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
@@ -261,6 +261,15 @@ fn main() {
261261
if let Ok(host_linker) = env::var("RUSTC_HOST_LINKER") {
262262
cmd.arg(format!("-Clinker={}", host_linker));
263263
}
264+
265+
if let Ok(s) = env::var("RUSTC_HOST_CRT_STATIC") {
266+
if s == "true" {
267+
cmd.arg("-C").arg("target-feature=+crt-static");
268+
}
269+
if s == "false" {
270+
cmd.arg("-C").arg("target-feature=-crt-static");
271+
}
272+
}
264273
}
265274

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

src/bootstrap/builder.rs

+4
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,10 @@ impl<'a> Builder<'a> {
663663
cargo.env("RUSTC_CRT_STATIC", x.to_string());
664664
}
665665

666+
if let Some(x) = self.crt_static(compiler.host) {
667+
cargo.env("RUSTC_HOST_CRT_STATIC", x.to_string());
668+
}
669+
666670
// Enable usage of unstable features
667671
cargo.env("RUSTC_BOOTSTRAP", "1");
668672
self.add_rust_test_threads(&mut cargo);

0 commit comments

Comments
 (0)