about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/build_system/build_backend.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_codegen_cranelift/build_system/build_backend.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/build_system/build_backend.rs17
1 files changed, 4 insertions, 13 deletions
diff --git a/compiler/rustc_codegen_cranelift/build_system/build_backend.rs b/compiler/rustc_codegen_cranelift/build_system/build_backend.rs
index 129713e574a..02da89f737c 100644
--- a/compiler/rustc_codegen_cranelift/build_system/build_backend.rs
+++ b/compiler/rustc_codegen_cranelift/build_system/build_backend.rs
@@ -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"))
 }