Skip to content

Commit 5e67656

Browse files
committed
tmp: enable rust-lld by default
1 parent 926a36e commit 5e67656

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

compiler/rustc_target/src/spec/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,12 @@ impl LinkSelfContained {
619619
_ => "crt-objects-fallback",
620620
}
621621
}
622+
623+
/// Creates a `LinkSelfContained` enabling the self-contained linker for target specs (the
624+
/// equivalent of `-Clink-self-contained=+linker` on the CLI).
625+
pub(crate) fn with_linker() -> LinkSelfContained {
626+
LinkSelfContained::WithComponents(LinkSelfContainedComponents::LINKER)
627+
}
622628
}
623629

624630
impl From<LinkSelfContainedDefault> for LinkSelfContained {

compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
use crate::spec::LinkSelfContained;
12
use crate::spec::{Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target};
23

34
pub fn target() -> Target {
45
let mut base = super::linux_gnu_base::opts();
56
base.cpu = "x86-64".into();
67
base.plt_by_default = false;
78
base.max_atomic_width = Some(64);
9+
base.linker_flavor = LinkerFlavor::Gnu(Cc::Yes, Lld::Yes);
10+
base.link_self_contained = LinkSelfContained::with_linker();
811
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
912
base.stack_probes = StackProbeType::X86;
1013
base.static_position_independent_executables = true;

0 commit comments

Comments
 (0)