@@ -6,11 +6,10 @@ use crate::rustc_info::get_file_name;
66use crate :: shared_utils:: { rustflags_from_env, rustflags_to_cmd_env} ;
77use crate :: utils:: { CargoProject , Compiler , LogGroup } ;
88
9- pub ( crate ) static CG_CLIF : CargoProject = CargoProject :: new ( & RelPath :: SOURCE , "cg_clif" ) ;
9+ static CG_CLIF : CargoProject = CargoProject :: new ( & RelPath :: SOURCE , "cg_clif" ) ;
1010
1111pub ( crate ) fn build_backend (
1212 dirs : & Dirs ,
13- channel : & str ,
1413 bootstrap_host_compiler : & Compiler ,
1514 use_unstable_features : bool ,
1615) -> PathBuf {
@@ -19,8 +18,8 @@ pub(crate) fn build_backend(
1918 let mut cmd = CG_CLIF . build ( & bootstrap_host_compiler, dirs) ;
2019
2120 let mut rustflags = rustflags_from_env ( "RUSTFLAGS" ) ;
22-
2321 rustflags. push ( "-Zallow-features=rustc_private" . to_owned ( ) ) ;
22+ rustflags_to_cmd_env ( & mut cmd, "RUSTFLAGS" , & rustflags) ;
2423
2524 if env:: var ( "CG_CLIF_EXPENSIVE_CHECKS" ) . is_ok ( ) {
2625 // Enabling debug assertions implicitly enables the clif ir verifier
@@ -32,22 +31,14 @@ pub(crate) fn build_backend(
3231 cmd. arg ( "--features" ) . arg ( "unstable-features" ) ;
3332 }
3433
35- match channel {
36- "debug" => { }
37- "release" => {
38- cmd. arg ( "--release" ) ;
39- }
40- _ => unreachable ! ( ) ,
41- }
42-
43- rustflags_to_cmd_env ( & mut cmd, "RUSTFLAGS" , & rustflags) ;
34+ cmd. arg ( "--release" ) ;
4435
4536 eprintln ! ( "[BUILD] rustc_codegen_cranelift" ) ;
4637 crate :: utils:: spawn_and_wait ( cmd) ;
4738
4839 CG_CLIF
4940 . target_dir ( dirs)
5041 . join ( & bootstrap_host_compiler. triple )
51- . join ( channel )
42+ . join ( "release" )
5243 . join ( get_file_name ( & bootstrap_host_compiler. rustc , "rustc_codegen_cranelift" , "dylib" ) )
5344}
0 commit comments