File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ use std::sync::OnceLock;
1515use std:: time:: { Instant , SystemTime , UNIX_EPOCH } ;
1616
1717use crate :: core:: builder:: Builder ;
18- use crate :: core:: config:: { Config , TargetSelection } ;
18+ use crate :: core:: config:: { Config , LldMode , TargetSelection } ;
1919
2020pub use crate :: utils:: dylib:: { dylib_path, dylib_path_var} ;
2121
@@ -500,7 +500,16 @@ pub fn linker_flags(
500500) -> Vec < String > {
501501 let mut args = vec ! [ ] ;
502502 if !builder. is_lld_direct_linker ( target) && builder. config . lld_mode . is_used ( ) {
503- args. push ( String :: from ( "-Clink-arg=-fuse-ld=lld" ) ) ;
503+ match builder. config . lld_mode {
504+ LldMode :: External => {
505+ args. push ( "-Clinker-flavor=gnu-lld-cc" . to_string ( ) ) ;
506+ }
507+ LldMode :: SelfContained => {
508+ args. push ( "-Clinker-flavor=gnu-lld-cc" . to_string ( ) ) ;
509+ args. push ( "-Clink-self-contained=+linker" . to_string ( ) ) ;
510+ }
511+ LldMode :: Unused => { }
512+ }
504513
505514 if matches ! ( lld_threads, LldThreads :: No ) {
506515 args. push ( format ! ( "-Clink-arg=-Wl,{}" , lld_flag_no_threads( target. is_msvc( ) ) ) ) ;
You can’t perform that action at this time.
0 commit comments