Skip to content

Commit 1e5940d

Browse files
committed
tmp: enable rust-lld by default
1 parent 2523b0c commit 1e5940d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

compiler/rustc_target/src/spec/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,12 @@ impl LinkSelfContained {
621621
_ => "crt-objects-fallback",
622622
}
623623
}
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+
}
624630
}
625631

626632
impl From<LinkSelfContainedDefault> for LinkSelfContained {

compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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::LinkSelfContained::with_linker();
23+
}
24+
1925
Target {
2026
llvm_target: "x86_64-unknown-linux-gnu".into(),
2127
pointer_width: 64,

0 commit comments

Comments
 (0)