@@ -90,7 +90,6 @@ fn show_usage() {
90
90
91
91
--release : Build codegen in release mode
92
92
--sysroot-panic-abort : Build the sysroot without unwinding support.
93
- --no-default-features : Add `--no-default-features` flag
94
93
--features [arg] : Add a new feature [arg]
95
94
--use-system-gcc : Use system installed libgccjit
96
95
--build-only : Only build rustc_codegen_gcc then exits
@@ -110,7 +109,6 @@ fn show_usage() {
110
109
111
110
#[ derive( Default , Debug ) ]
112
111
struct TestArg {
113
- no_default_features : bool ,
114
112
build_only : bool ,
115
113
use_system_gcc : bool ,
116
114
runners : BTreeSet < String > ,
@@ -132,13 +130,6 @@ impl TestArg {
132
130
133
131
while let Some ( arg) = args. next ( ) {
134
132
match arg. as_str ( ) {
135
- "--no-default-features" => {
136
- // To prevent adding it more than once.
137
- if !test_arg. no_default_features {
138
- test_arg. flags . push ( "--no-default-features" . into ( ) ) ;
139
- }
140
- test_arg. no_default_features = true ;
141
- }
142
133
"--features" => match args. next ( ) {
143
134
Some ( feature) if !feature. is_empty ( ) => {
144
135
test_arg
@@ -196,11 +187,14 @@ impl TestArg {
196
187
) ;
197
188
}
198
189
}
190
+ if test_arg. config_info . no_default_features {
191
+ test_arg. flags . push ( "--no-default-features" . into ( ) ) ;
192
+ }
199
193
Ok ( Some ( test_arg) )
200
194
}
201
195
202
196
pub fn is_using_gcc_master_branch ( & self ) -> bool {
203
- !self . no_default_features
197
+ !self . config_info . no_default_features
204
198
}
205
199
}
206
200
@@ -612,20 +606,23 @@ fn asm_tests(env: &Env, args: &TestArg) -> Result<(), String> {
612
606
613
607
env. insert ( "COMPILETEST_FORCE_STAGE0" . to_string ( ) , "1" . to_string ( ) ) ;
614
608
615
- let rustc_args =
616
- & format ! (
617
- r#"-Zpanic-abort-tests \
618
- -Zcodegen-backend="{pwd}/target/{channel}/librustc_codegen_gcc.{dylib_ext}" \
619
- --sysroot "{pwd}/build_sysroot/sysroot" -Cpanic=abort"# ,
620
- pwd = std:: env:: current_dir( )
621
- . map_err( |error| format!( "`current_dir` failed: {:?}" , error) ) ?
622
- . display( ) ,
623
- channel = args. config_info. channel. as_str( ) ,
624
- dylib_ext = args. config_info. dylib_ext,
625
- ) ;
609
+ let extra = if args. is_using_gcc_master_branch ( ) {
610
+ ""
611
+ } else {
612
+ " -Csymbol-mangling-version=v0"
613
+ } ;
626
614
627
- #[ cfg( not( feature="master" ) ) ]
628
- let rustc_args = format ! ( "{} -Csymbol-mangling-version=v0" , rustc_args) ;
615
+ let rustc_args = & format ! (
616
+ r#"-Zpanic-abort-tests \
617
+ -Zcodegen-backend="{pwd}/target/{channel}/librustc_codegen_gcc.{dylib_ext}" \
618
+ --sysroot "{pwd}/build_sysroot/sysroot" -Cpanic=abort{extra}"# ,
619
+ pwd = std:: env:: current_dir( )
620
+ . map_err( |error| format!( "`current_dir` failed: {:?}" , error) ) ?
621
+ . display( ) ,
622
+ channel = args. config_info. channel. as_str( ) ,
623
+ dylib_ext = args. config_info. dylib_ext,
624
+ extra = extra,
625
+ ) ;
629
626
630
627
run_command_with_env (
631
628
& [
@@ -1069,16 +1066,21 @@ where
1069
1066
// FIXME: create a function "display_if_not_quiet" or something along the line.
1070
1067
println ! ( "[TEST] rustc test suite" ) ;
1071
1068
env. insert ( "COMPILETEST_FORCE_STAGE0" . to_string ( ) , "1" . to_string ( ) ) ;
1069
+
1070
+ let extra = if args. is_using_gcc_master_branch ( ) {
1071
+ ""
1072
+ } else {
1073
+ " -Csymbol-mangling-version=v0"
1074
+ } ;
1075
+
1072
1076
let rustc_args = format ! (
1073
- "{} -Zcodegen-backend={} --sysroot {}" ,
1077
+ "{} -Zcodegen-backend={} --sysroot {}{} " ,
1074
1078
env. get( "TEST_FLAGS" ) . unwrap_or( & String :: new( ) ) ,
1075
1079
args. config_info. cg_backend_path,
1076
1080
args. config_info. sysroot_path,
1081
+ extra,
1077
1082
) ;
1078
1083
1079
- #[ cfg( not( feature="master" ) ) ]
1080
- let rustc_args = format ! ( "{} -Csymbol-mangling-version=v0" , rustc_args) ;
1081
-
1082
1084
env. get_mut ( "RUSTFLAGS" ) . unwrap ( ) . clear ( ) ;
1083
1085
run_command_with_output_and_env (
1084
1086
& [
0 commit comments