Move handling of {MUSL,WASI}_ROOT to compile.rs

No longer any need for them to live in `rustc.rs`!
This commit is contained in:
Alex Crichton
2019-09-09 10:21:15 -07:00
parent 0b6766d8d7
commit 3d13f46304
3 changed files with 12 additions and 21 deletions

View File

@@ -220,15 +220,19 @@ pub fn std_cargo(builder: &Builder<'_>,
.arg("--manifest-path")
.arg(builder.src.join("src/libtest/Cargo.toml"));
// Help the libc crate compile by assisting it in finding various
// sysroot native libraries.
if target.contains("musl") {
if let Some(p) = builder.musl_root(target) {
cargo.env("MUSL_ROOT", p);
let root = format!("native={}/lib", p.to_str().unwrap());
cargo.rustflag("-L").rustflag(&root);
}
}
if target.ends_with("-wasi") {
if let Some(p) = builder.wasi_root(target) {
cargo.env("WASI_ROOT", p);
let root = format!("native={}/lib/wasm32-wasi", p.to_str().unwrap());
cargo.rustflag("-L").rustflag(&root);
}
}
}