File tree 4 files changed +11
-15
lines changed
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> {
755
755
cmd. env_remove ( "MAKEFLAGS" ) ;
756
756
cmd. env_remove ( "MFLAGS" ) ;
757
757
758
- if let Some ( linker) = self . linker ( compiler. host , true ) {
758
+ if let Some ( linker) = self . linker ( compiler. host ) {
759
759
cmd. env ( "RUSTC_TARGET_LINKER" , linker) ;
760
760
}
761
761
cmd
@@ -1041,11 +1041,11 @@ impl<'a> Builder<'a> {
1041
1041
}
1042
1042
}
1043
1043
1044
- if let Some ( host_linker) = self . linker ( compiler. host , true ) {
1044
+ if let Some ( host_linker) = self . linker ( compiler. host ) {
1045
1045
cargo. env ( "RUSTC_HOST_LINKER" , host_linker) ;
1046
1046
}
1047
1047
1048
- if let Some ( target_linker) = self . linker ( target, true ) {
1048
+ if let Some ( target_linker) = self . linker ( target) {
1049
1049
let target = crate :: envify ( & target. triple ) ;
1050
1050
cargo. env ( & format ! ( "CARGO_TARGET_{}_LINKER" , target) , target_linker) ;
1051
1051
}
Original file line number Diff line number Diff line change @@ -850,7 +850,7 @@ impl Build {
850
850
}
851
851
852
852
/// 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 > {
854
854
if let Some ( linker) = self . config . target_config . get ( & target) . and_then ( |c| c. linker . as_ref ( ) )
855
855
{
856
856
Some ( linker)
@@ -863,12 +863,9 @@ impl Build {
863
863
&& !target. contains ( "msvc" )
864
864
{
865
865
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.
872
869
Some ( & self . initial_lld )
873
870
} else {
874
871
None
Original file line number Diff line number Diff line change @@ -600,7 +600,7 @@ impl Step for RustdocTheme {
600
600
. env ( "CFG_RELEASE_CHANNEL" , & builder. config . channel )
601
601
. env ( "RUSTDOC_REAL" , builder. rustdoc ( self . compiler ) )
602
602
. 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 ) {
604
604
cmd. env ( "RUSTC_TARGET_LINKER" , linker) ;
605
605
}
606
606
try_run ( builder, & mut cmd) ;
@@ -1061,8 +1061,7 @@ impl Step for Compiletest {
1061
1061
flags. push ( "-Zunstable-options" . to_string ( ) ) ;
1062
1062
flags. push ( builder. config . cmd . rustc_args ( ) . join ( " " ) ) ;
1063
1063
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) {
1066
1065
cmd. arg ( "--linker" ) . arg ( linker) ;
1067
1066
}
1068
1067
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ BARE_RUSTDOC := $(HOST_RPATH_ENV) '$(RUSTDOC)'
11
11
RUSTC := $(BARE_RUSTC ) --out-dir $(TMPDIR ) -L $(TMPDIR ) $(RUSTFLAGS )
12
12
RUSTDOC := $(BARE_RUSTDOC ) -L $(TARGET_RPATH_DIR )
13
13
ifdef 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 ) '
16
16
endif
17
17
# CC := $(CC) -L $(TMPDIR)
18
18
HTMLDOCCK := '$(PYTHON ) ' '$(S ) /src/etc/htmldocck.py'
You can’t perform that action at this time.
0 commit comments