Skip to content

Commit 3fda3c3

Browse files
committed
restore rust-lld with windows-gnu
1 parent f7359ae commit 3fda3c3

File tree

1 file changed

+4
-13
lines changed
  • compiler/rustc_codegen_ssa/src/back

1 file changed

+4
-13
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,21 +1781,12 @@ fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind {
17811781
// using rust-lld directly (`-gnullvm`) or using shipped cc to call the linker (`-gnu`).
17821782
// Eventually, `-gnu` toolchains might be moved to calling the linker directly.
17831783
fn detect_self_contained_mingw(sess: &Session) -> bool {
1784-
// Passing custom linker means non-self-contained mode.
1785-
if sess.opts.cg.linker.is_some() {
1786-
// Unless running on `-windows-gnu-llvm` and using `-C linker=rust-lld`.
1787-
if sess.target.abi == Abi::Llvm {
1788-
return sess
1789-
.opts
1790-
.cg
1791-
.linker
1792-
.as_ref()
1793-
.is_some_and(|linker| linker == Path::new("rust-lld"));
1794-
}
1795-
1796-
return false;
1784+
// Passing explicit linker other than `rust-lld` means non-self-contained mode.
1785+
if let Some(linker) = &sess.opts.cg.linker {
1786+
return linker == Path::new("rust-lld");
17971787
}
17981788

1789+
// If no explicit linker was given, proceed with implicit one (if present);
17991790
let linker_with_extension = if let Some(linker) = sess.target.linker.as_deref().map(Path::new) {
18001791
linker.with_extension("exe")
18011792
} else {

0 commit comments

Comments
 (0)