Skip to content

Commit 918f26d

Browse files
authored
Rollup merge of rust-lang#58976 - phil-opp:patch-2, r=alexcrichton
Default to integrated `rust-lld` linker for UEFI targets The `x86_64-unknown-uefi` target was added in rust-lang#56769 with the linker defaulting to `lld-link`. This means that a system linker with that name is required for linking. I think defaulting to `rust-lld`, which is shipped with Rust, is a better default for the following reasons: - Most systems don't have `lld-link` installed, so it forces users to install it first. - The naming of LLD executables is not standarized, so users often need to create an additional symlink before things work. For example, on Ubuntu `apt install lld` leads to an executable named `lld-link-6.0`. - We already default to `rust-lld` for [many targets](https://github.com/rust-lang/rust/search?utf8=%E2%9C%93&q=rust-lld&type=), including embedded and WASM targets, so doing the same for UEFI crates seems consistent to me. (It even seems like `x86_64-unknown-uefi` is the [only target](https://github.com/rust-lang/rust/search?q=lld-link&unscoped_q=lld-link) that uses `lld-link`.) cc @dvdhrm who added the target and @KKK669 who [proposed to use `rust-lld`](rust-lang#56769 (comment)).
2 parents 2e6a240 + 876258b commit 918f26d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_target/spec/uefi_base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub fn opts() -> TargetOptions {
5959
singlethread: true,
6060
emit_debug_gdb_scripts: false,
6161

62-
linker: Some("lld-link".to_string()),
62+
linker: Some("rust-lld".to_string()),
6363
lld_flavor: LldFlavor::Link,
6464
pre_link_args,
6565

0 commit comments

Comments
 (0)