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 @@ -621,6 +621,12 @@ impl LinkSelfContained {
621
621
_ => "crt-objects-fallback" ,
622
622
}
623
623
}
624
+
625
+ /// Creates a `LinkSelfContained` enabling the self-contained linker for target specs (the
626
+ /// equivalent of `-Clink-self-contained=+linker` on the CLI).
627
+ pub fn with_linker ( ) -> LinkSelfContained {
628
+ LinkSelfContained :: WithComponents ( LinkSelfContainedComponents :: LINKER )
629
+ }
624
630
}
625
631
626
632
impl From < LinkSelfContainedDefault > for LinkSelfContained {
Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ pub fn target() -> Target {
16
16
| SanitizerSet :: THREAD ;
17
17
base. supports_xray = true ;
18
18
19
+ #[ cfg( rust_lld) ]
20
+ {
21
+ base. linker_flavor = LinkerFlavor :: Gnu ( Cc :: Yes , Lld :: Yes ) ;
22
+ base. link_self_contained = crate :: spec:: LinkSelfContained :: with_linker ( ) ;
23
+ }
24
+
19
25
Target {
20
26
llvm_target : "x86_64-unknown-linux-gnu" . into ( ) ,
21
27
pointer_width : 64 ,
You can’t perform that action at this time.
0 commit comments