bootstrap: Move RUSTC_CRT_STATIC to builder.rs

This commit is contained in:
Alex Crichton 2019-08-15 13:57:09 -07:00
parent 04cb0653a8
commit ac29809940
2 changed files with 7 additions and 8 deletions

View File

@ -232,13 +232,8 @@ fn main() {
}
}
if let Ok(s) = env::var("RUSTC_CRT_STATIC") {
if s == "true" {
cmd.arg("-C").arg("target-feature=+crt-static");
}
if s == "false" {
cmd.arg("-C").arg("target-feature=-crt-static");
}
if let Ok(map) = env::var("RUSTC_DEBUGINFO_MAP") {
cmd.arg("--remap-path-prefix").arg(&map);
}
} else {
// Override linker if necessary.

View File

@ -945,7 +945,11 @@ impl<'a> Builder<'a> {
}
if let Some(x) = self.crt_static(target) {
cargo.env("RUSTC_CRT_STATIC", x.to_string());
if x {
rustflags.arg("-Ctarget-feature=+crt-static");
} else {
rustflags.arg("-Ctarget-feature=-crt-static");
}
}
if let Some(x) = self.crt_static(compiler.host) {