@@ -6,11 +6,10 @@ use crate::rustc_info::get_file_name;
6
6
use crate :: shared_utils:: { rustflags_from_env, rustflags_to_cmd_env} ;
7
7
use crate :: utils:: { CargoProject , Compiler , LogGroup } ;
8
8
9
- pub ( crate ) static CG_CLIF : CargoProject = CargoProject :: new ( & RelPath :: SOURCE , "cg_clif" ) ;
9
+ static CG_CLIF : CargoProject = CargoProject :: new ( & RelPath :: SOURCE , "cg_clif" ) ;
10
10
11
11
pub ( crate ) fn build_backend (
12
12
dirs : & Dirs ,
13
- channel : & str ,
14
13
bootstrap_host_compiler : & Compiler ,
15
14
use_unstable_features : bool ,
16
15
) -> PathBuf {
@@ -19,8 +18,8 @@ pub(crate) fn build_backend(
19
18
let mut cmd = CG_CLIF . build ( & bootstrap_host_compiler, dirs) ;
20
19
21
20
let mut rustflags = rustflags_from_env ( "RUSTFLAGS" ) ;
22
-
23
21
rustflags. push ( "-Zallow-features=rustc_private" . to_owned ( ) ) ;
22
+ rustflags_to_cmd_env ( & mut cmd, "RUSTFLAGS" , & rustflags) ;
24
23
25
24
if env:: var ( "CG_CLIF_EXPENSIVE_CHECKS" ) . is_ok ( ) {
26
25
// Enabling debug assertions implicitly enables the clif ir verifier
@@ -32,22 +31,14 @@ pub(crate) fn build_backend(
32
31
cmd. arg ( "--features" ) . arg ( "unstable-features" ) ;
33
32
}
34
33
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" ) ;
44
35
45
36
eprintln ! ( "[BUILD] rustc_codegen_cranelift" ) ;
46
37
crate :: utils:: spawn_and_wait ( cmd) ;
47
38
48
39
CG_CLIF
49
40
. target_dir ( dirs)
50
41
. join ( & bootstrap_host_compiler. triple )
51
- . join ( channel )
42
+ . join ( "release" )
52
43
. join ( get_file_name ( & bootstrap_host_compiler. rustc , "rustc_codegen_cranelift" , "dylib" ) )
53
44
}
0 commit comments