File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed 
compiler/rustc_target/src/spec Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -625,6 +625,12 @@ impl LinkSelfContainedDefault {
625625            _ => "crt-objects-fallback" , 
626626        } 
627627    } 
628+ 
629+     /// Creates a `LinkSelfContained` enabling the self-contained linker for target specs (the 
630+      /// equivalent of `-Clink-self-contained=+linker` on the CLI). 
631+      pub  fn  with_linker ( )  -> LinkSelfContainedDefault  { 
632+         LinkSelfContainedDefault :: WithComponents ( LinkSelfContainedComponents :: LINKER ) 
633+     } 
628634} 
629635
630636bitflags:: bitflags! { 
Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ pub fn target() -> Target {
1616        | SanitizerSet :: THREAD ; 
1717    base. supports_xray  = true ; 
1818
19+     #[ cfg( rust_lld) ]  
20+     { 
21+         base. linker_flavor  = LinkerFlavor :: Gnu ( Cc :: Yes ,  Lld :: Yes ) ; 
22+         base. link_self_contained  = crate :: spec:: LinkSelfContainedDefault :: with_linker ( ) ; 
23+     } 
24+ 
1925    Target  { 
2026        llvm_target :  "x86_64-unknown-linux-gnu" . into ( ) , 
2127        pointer_width :  64 , 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments