File tree Expand file tree Collapse file tree 4 files changed +11
-15
lines changed Expand file tree Collapse file tree 4 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -755,7 +755,7 @@ impl<'a> Builder<'a> {
755755 cmd. env_remove ( "MAKEFLAGS" ) ;
756756 cmd. env_remove ( "MFLAGS" ) ;
757757
758- if let Some ( linker) = self . linker ( compiler. host , true ) {
758+ if let Some ( linker) = self . linker ( compiler. host ) {
759759 cmd. env ( "RUSTC_TARGET_LINKER" , linker) ;
760760 }
761761 cmd
@@ -1041,11 +1041,11 @@ impl<'a> Builder<'a> {
10411041 }
10421042 }
10431043
1044- if let Some ( host_linker) = self . linker ( compiler. host , true ) {
1044+ if let Some ( host_linker) = self . linker ( compiler. host ) {
10451045 cargo. env ( "RUSTC_HOST_LINKER" , host_linker) ;
10461046 }
10471047
1048- if let Some ( target_linker) = self . linker ( target, true ) {
1048+ if let Some ( target_linker) = self . linker ( target) {
10491049 let target = crate :: envify ( & target. triple ) ;
10501050 cargo. env ( & format ! ( "CARGO_TARGET_{}_LINKER" , target) , target_linker) ;
10511051 }
Original file line number Diff line number Diff line change @@ -850,7 +850,7 @@ impl Build {
850850 }
851851
852852 /// Returns the path to the linker for the given target if it needs to be overridden.
853- fn linker ( & self , target : TargetSelection , can_use_lld : bool ) -> Option < & Path > {
853+ fn linker ( & self , target : TargetSelection ) -> Option < & Path > {
854854 if let Some ( linker) = self . config . target_config . get ( & target) . and_then ( |c| c. linker . as_ref ( ) )
855855 {
856856 Some ( linker)
@@ -863,12 +863,9 @@ impl Build {
863863 && !target. contains ( "msvc" )
864864 {
865865 Some ( self . cc ( target) )
866- } else if target. contains ( "msvc" )
867- && can_use_lld
868- && self . config . use_lld
869- && self . build == target
870- {
871- // Currently we support using LLD directly via `rust.use_lld` option only with MSVC
866+ } else if target. contains ( "msvc" ) && self . config . use_lld && self . build == target {
867+ // `rust.use_lld` means using LLD directly only for MSVC, for other targets it only
868+ // adds `-fuse-ld=lld` to already selected linker.
872869 Some ( & self . initial_lld )
873870 } else {
874871 None
Original file line number Diff line number Diff line change @@ -600,7 +600,7 @@ impl Step for RustdocTheme {
600600 . env ( "CFG_RELEASE_CHANNEL" , & builder. config . channel )
601601 . env ( "RUSTDOC_REAL" , builder. rustdoc ( self . compiler ) )
602602 . env ( "RUSTC_BOOTSTRAP" , "1" ) ;
603- if let Some ( linker) = builder. linker ( self . compiler . host , true ) {
603+ if let Some ( linker) = builder. linker ( self . compiler . host ) {
604604 cmd. env ( "RUSTC_TARGET_LINKER" , linker) ;
605605 }
606606 try_run ( builder, & mut cmd) ;
@@ -1061,8 +1061,7 @@ impl Step for Compiletest {
10611061 flags. push ( "-Zunstable-options" . to_string ( ) ) ;
10621062 flags. push ( builder. config . cmd . rustc_args ( ) . join ( " " ) ) ;
10631063
1064- // Don't use LLD here since we want to test that rustc finds and uses a linker by itself.
1065- if let Some ( linker) = builder. linker ( target, false ) {
1064+ if let Some ( linker) = builder. linker ( target) {
10661065 cmd. arg ( "--linker" ) . arg ( linker) ;
10671066 }
10681067
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ BARE_RUSTDOC := $(HOST_RPATH_ENV) '$(RUSTDOC)'
1111RUSTC := $(BARE_RUSTC ) --out-dir $(TMPDIR ) -L $(TMPDIR ) $(RUSTFLAGS )
1212RUSTDOC := $(BARE_RUSTDOC ) -L $(TARGET_RPATH_DIR )
1313ifdef RUSTC_LINKER
14- RUSTC := $(RUSTC ) -Clinker=$(RUSTC_LINKER )
15- RUSTDOC := $(RUSTDOC ) -Clinker=$(RUSTC_LINKER )
14+ RUSTC := $(RUSTC ) -Clinker=' $(RUSTC_LINKER ) '
15+ RUSTDOC := $(RUSTDOC ) -Clinker=' $(RUSTC_LINKER ) '
1616endif
1717# CC := $(CC) -L $(TMPDIR)
1818HTMLDOCCK := '$(PYTHON ) ' '$(S ) /src/etc/htmldocck.py'
You can’t perform that action at this time.
0 commit comments