@@ -3,7 +3,6 @@ use super::command::Command;
33use super :: symbol_export;
44use rustc_span:: symbol:: sym;
55
6- use rustc_data_structures:: fx:: FxHashMap ;
76use std:: env;
87use std:: ffi:: { OsStr , OsString } ;
98use std:: fs:: { self , File } ;
@@ -1323,7 +1322,9 @@ impl<'a> Linker for L4Bender<'a> {
13231322 fn partial_relro ( & mut self ) { self . cmd . arg ( "-z,relro" ) ; }
13241323 fn no_relro ( & mut self ) { self . cmd . arg ( "-z,norelro" ) ; }
13251324 fn build_static_executable ( & mut self ) { self . cmd . arg ( "-static" ) ; }
1326- fn args ( & mut self , args : & [ String ] ) { self . cmd . args ( args) ; }
1325+ fn cmd ( & mut self ) -> & mut Command {
1326+ & mut self . cmd
1327+ }
13271328
13281329 fn link_rust_dylib ( & mut self , _: Symbol , _: & Path ) {
13291330 panic ! ( "Rust dylibs not supported" ) ;
@@ -1362,19 +1363,15 @@ impl<'a> Linker for L4Bender<'a> {
13621363
13631364 fn pgo_gen ( & mut self ) { }
13641365
1365- fn debuginfo ( & mut self ) {
1366- match self . sess . opts . debuginfo {
1367- DebugInfo :: None => {
1368- // If we are building without debuginfo enabled and we were called with
1369- // `-Zstrip-debuginfo-if-disabled=yes`, tell the linker to strip any debuginfo
1370- // found when linking to get rid of symbols from libstd.
1371- match self . sess . opts . debugging_opts . strip_debuginfo_if_disabled {
1372- Some ( true ) => { self . cmd . arg ( "-S" ) ; } ,
1373- _ => { } ,
1374- }
1375- } ,
1376- _ => { } ,
1377- } ;
1366+ fn debuginfo ( & mut self , strip : Strip ) {
1367+ match strip {
1368+ Strip :: None => { }
1369+ Strip :: Debuginfo => {
1370+ self . cmd ( ) . arg ( "--strip-debug" ) ; }
1371+ Strip :: Symbols => {
1372+ self . cmd ( ) . arg ( "--strip-all" ) ;
1373+ }
1374+ }
13781375 }
13791376
13801377 fn no_default_libraries ( & mut self ) {
@@ -1394,11 +1391,8 @@ impl<'a> Linker for L4Bender<'a> {
13941391 self . cmd . arg ( & format ! ( "--subsystem,{}" , subsystem) ) ;
13951392 }
13961393
1397- fn finalize ( & mut self ) -> Command {
1394+ fn finalize ( & mut self ) {
13981395 self . hint_static ( ) ; // Reset to default before returning the composed command line.
1399- let mut cmd = Command :: new ( "" ) ;
1400- :: std:: mem:: swap ( & mut cmd, & mut self . cmd ) ;
1401- cmd
14021396 }
14031397
14041398 fn group_start ( & mut self ) { self . cmd . arg ( "--start-group" ) ; }
@@ -1409,6 +1403,8 @@ impl<'a> Linker for L4Bender<'a> {
14091403 fn control_flow_guard ( & mut self ) {
14101404 self . sess . warn ( "Windows Control Flow Guard is not supported by this linker." ) ;
14111405 }
1406+
1407+ fn no_crt_objects ( & mut self ) { }
14121408}
14131409
14141410impl < ' a > L4Bender < ' a > {
0 commit comments