@@ -3,7 +3,6 @@ use super::command::Command;
3
3
use super :: symbol_export;
4
4
use rustc_span:: symbol:: sym;
5
5
6
- use rustc_data_structures:: fx:: FxHashMap ;
7
6
use std:: env;
8
7
use std:: ffi:: { OsStr , OsString } ;
9
8
use std:: fs:: { self , File } ;
@@ -1323,7 +1322,9 @@ impl<'a> Linker for L4Bender<'a> {
1323
1322
fn partial_relro ( & mut self ) { self . cmd . arg ( "-z,relro" ) ; }
1324
1323
fn no_relro ( & mut self ) { self . cmd . arg ( "-z,norelro" ) ; }
1325
1324
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
+ }
1327
1328
1328
1329
fn link_rust_dylib ( & mut self , _: Symbol , _: & Path ) {
1329
1330
panic ! ( "Rust dylibs not supported" ) ;
@@ -1362,19 +1363,15 @@ impl<'a> Linker for L4Bender<'a> {
1362
1363
1363
1364
fn pgo_gen ( & mut self ) { }
1364
1365
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
+ }
1378
1375
}
1379
1376
1380
1377
fn no_default_libraries ( & mut self ) {
@@ -1394,11 +1391,8 @@ impl<'a> Linker for L4Bender<'a> {
1394
1391
self . cmd . arg ( & format ! ( "--subsystem,{}" , subsystem) ) ;
1395
1392
}
1396
1393
1397
- fn finalize ( & mut self ) -> Command {
1394
+ fn finalize ( & mut self ) {
1398
1395
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
1402
1396
}
1403
1397
1404
1398
fn group_start ( & mut self ) { self . cmd . arg ( "--start-group" ) ; }
@@ -1409,6 +1403,8 @@ impl<'a> Linker for L4Bender<'a> {
1409
1403
fn control_flow_guard ( & mut self ) {
1410
1404
self . sess . warn ( "Windows Control Flow Guard is not supported by this linker." ) ;
1411
1405
}
1406
+
1407
+ fn no_crt_objects ( & mut self ) { }
1412
1408
}
1413
1409
1414
1410
impl < ' a > L4Bender < ' a > {
0 commit comments