@@ -90,7 +90,6 @@ fn show_usage() {
9090
9191 --release : Build codegen in release mode
9292 --sysroot-panic-abort : Build the sysroot without unwinding support.
93- --no-default-features : Add `--no-default-features` flag
9493 --features [arg] : Add a new feature [arg]
9594 --use-system-gcc : Use system installed libgccjit
9695 --build-only : Only build rustc_codegen_gcc then exits
@@ -110,7 +109,6 @@ fn show_usage() {
110109
111110#[ derive( Default , Debug ) ]
112111struct TestArg {
113- no_default_features : bool ,
114112 build_only : bool ,
115113 use_system_gcc : bool ,
116114 runners : BTreeSet < String > ,
@@ -132,13 +130,6 @@ impl TestArg {
132130
133131 while let Some ( arg) = args. next ( ) {
134132 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- }
142133 "--features" => match args. next ( ) {
143134 Some ( feature) if !feature. is_empty ( ) => {
144135 test_arg
@@ -196,11 +187,14 @@ impl TestArg {
196187 ) ;
197188 }
198189 }
190+ if test_arg. config_info . no_default_features {
191+ test_arg. flags . push ( "--no-default-features" . into ( ) ) ;
192+ }
199193 Ok ( Some ( test_arg) )
200194 }
201195
202196 pub fn is_using_gcc_master_branch ( & self ) -> bool {
203- !self . no_default_features
197+ !self . config_info . no_default_features
204198 }
205199}
206200
@@ -612,20 +606,23 @@ fn asm_tests(env: &Env, args: &TestArg) -> Result<(), String> {
612606
613607 env. insert ( "COMPILETEST_FORCE_STAGE0" . to_string ( ) , "1" . to_string ( ) ) ;
614608
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+ } ;
626614
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+ ) ;
629626
630627 run_command_with_env (
631628 & [
@@ -1069,16 +1066,21 @@ where
10691066 // FIXME: create a function "display_if_not_quiet" or something along the line.
10701067 println ! ( "[TEST] rustc test suite" ) ;
10711068 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+
10721076 let rustc_args = format ! (
1073- "{} -Zcodegen-backend={} --sysroot {}" ,
1077+ "{} -Zcodegen-backend={} --sysroot {}{} " ,
10741078 env. get( "TEST_FLAGS" ) . unwrap_or( & String :: new( ) ) ,
10751079 args. config_info. cg_backend_path,
10761080 args. config_info. sysroot_path,
1081+ extra,
10771082 ) ;
10781083
1079- #[ cfg( not( feature="master" ) ) ]
1080- let rustc_args = format ! ( "{} -Csymbol-mangling-version=v0" , rustc_args) ;
1081-
10821084 env. get_mut ( "RUSTFLAGS" ) . unwrap ( ) . clear ( ) ;
10831085 run_command_with_output_and_env (
10841086 & [
0 commit comments