Skip to content

Commit

Permalink
tmp: enable rust-lld by default
Browse files Browse the repository at this point in the history
  • Loading branch information
lqd committed Sep 21, 2023
1 parent 926a36e commit 5e67656
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,12 @@ impl LinkSelfContained {
_ => "crt-objects-fallback",
}
}

/// Creates a `LinkSelfContained` enabling the self-contained linker for target specs (the
/// equivalent of `-Clink-self-contained=+linker` on the CLI).
pub(crate) fn with_linker() -> LinkSelfContained {
LinkSelfContained::WithComponents(LinkSelfContainedComponents::LINKER)
}
}

impl From<LinkSelfContainedDefault> for LinkSelfContained {
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
use crate::spec::LinkSelfContained;
use crate::spec::{Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target};

pub fn target() -> Target {
let mut base = super::linux_gnu_base::opts();
base.cpu = "x86-64".into();
base.plt_by_default = false;
base.max_atomic_width = Some(64);
base.linker_flavor = LinkerFlavor::Gnu(Cc::Yes, Lld::Yes);
base.link_self_contained = LinkSelfContained::with_linker();
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
base.stack_probes = StackProbeType::X86;
base.static_position_independent_executables = true;
Expand Down

0 comments on commit 5e67656

Please sign in to comment.