Merge commit '6d35b4c9a0
' into sync_cg_clif-2024-09-22
This commit is contained in:
commit
b40fe1ee28
31 changed files with 487 additions and 347 deletions
|
@ -6,11 +6,10 @@ use crate::rustc_info::get_file_name;
|
|||
use crate::shared_utils::{rustflags_from_env, rustflags_to_cmd_env};
|
||||
use crate::utils::{CargoProject, Compiler, LogGroup};
|
||||
|
||||
pub(crate) static CG_CLIF: CargoProject = CargoProject::new(&RelPath::SOURCE, "cg_clif");
|
||||
static CG_CLIF: CargoProject = CargoProject::new(&RelPath::SOURCE, "cg_clif");
|
||||
|
||||
pub(crate) fn build_backend(
|
||||
dirs: &Dirs,
|
||||
channel: &str,
|
||||
bootstrap_host_compiler: &Compiler,
|
||||
use_unstable_features: bool,
|
||||
) -> PathBuf {
|
||||
|
@ -19,8 +18,8 @@ pub(crate) fn build_backend(
|
|||
let mut cmd = CG_CLIF.build(&bootstrap_host_compiler, dirs);
|
||||
|
||||
let mut rustflags = rustflags_from_env("RUSTFLAGS");
|
||||
|
||||
rustflags.push("-Zallow-features=rustc_private".to_owned());
|
||||
rustflags_to_cmd_env(&mut cmd, "RUSTFLAGS", &rustflags);
|
||||
|
||||
if env::var("CG_CLIF_EXPENSIVE_CHECKS").is_ok() {
|
||||
// Enabling debug assertions implicitly enables the clif ir verifier
|
||||
|
@ -32,15 +31,7 @@ pub(crate) fn build_backend(
|
|||
cmd.arg("--features").arg("unstable-features");
|
||||
}
|
||||
|
||||
match channel {
|
||||
"debug" => {}
|
||||
"release" => {
|
||||
cmd.arg("--release");
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
||||
rustflags_to_cmd_env(&mut cmd, "RUSTFLAGS", &rustflags);
|
||||
cmd.arg("--release");
|
||||
|
||||
eprintln!("[BUILD] rustc_codegen_cranelift");
|
||||
crate::utils::spawn_and_wait(cmd);
|
||||
|
@ -48,6 +39,6 @@ pub(crate) fn build_backend(
|
|||
CG_CLIF
|
||||
.target_dir(dirs)
|
||||
.join(&bootstrap_host_compiler.triple)
|
||||
.join(channel)
|
||||
.join("release")
|
||||
.join(get_file_name(&bootstrap_host_compiler.rustc, "rustc_codegen_cranelift", "dylib"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue