Pass --sysroot when building the new sysroot

To avoid accidentally loading the original libcore
This commit is contained in:
bjorn3 2022-09-25 15:14:59 +02:00
parent f82016891a
commit d422d50651

View File

@ -188,6 +188,7 @@ fn build_clif_sysroot_for_triple(
let mut build_cmd = cargo_command("cargo", "build", Some(triple), Path::new("build_sysroot")); let mut build_cmd = cargo_command("cargo", "build", Some(triple), Path::new("build_sysroot"));
let mut rustflags = "-Zforce-unstable-if-unmarked -Cpanic=abort".to_string(); let mut rustflags = "-Zforce-unstable-if-unmarked -Cpanic=abort".to_string();
rustflags.push_str(&format!(" -Zcodegen-backend={}", cg_clif_dylib_path.to_str().unwrap())); rustflags.push_str(&format!(" -Zcodegen-backend={}", cg_clif_dylib_path.to_str().unwrap()));
rustflags.push_str(&format!(" --sysroot={}", target_dir.to_str().unwrap()));
if channel == "release" { if channel == "release" {
build_cmd.arg("--release"); build_cmd.arg("--release");
rustflags.push_str(" -Zmir-opt-level=3"); rustflags.push_str(" -Zmir-opt-level=3");