Skip to content

Commit 07d76d4

Browse files
Rollup merge of #148613 - androm3da:bcain/hex_lld, r=JonathanBrouwer,Noratrieb
Switch hexagon targets to rust-lld lld is a great choice for a default linker.
2 parents 0ae62c9 + 5ed01e9 commit 07d76d4

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

compiler/rustc_target/src/spec/targets/hexagon_unknown_linux_musl.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ pub(crate) fn target() -> Target {
88
base.features = "-small-data,+hvx-length128b".into();
99

1010
base.has_rpath = true;
11+
base.linker = Some("rust-lld".into());
1112
base.linker_flavor = LinkerFlavor::Unix(Cc::Yes);
1213

1314
base.c_enum_min_bits = Some(8);

compiler/rustc_target/src/spec/targets/hexagon_unknown_none_elf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pub(crate) fn target() -> Target {
2727
max_atomic_width: Some(32),
2828
emit_debug_gdb_scripts: false,
2929
c_enum_min_bits: Some(8),
30+
linker: Some("rust-lld".into()),
3031
..Default::default()
3132
},
3233
}

src/doc/rustc/src/platform-support/hexagon-unknown-linux-musl.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ dynamically linked executables.
3939
# /opt/clang+llvm-18.1.0-cross-hexagon-unknown-linux-musl/x86_64-linux-gnu/bin/qemu-hexagon -L /opt/clang+llvm-18.1.0-cross-hexagon-unknown-linux-musl/x86_64-linux-gnu/target/hexagon-unknown-linux-musl/usr/ ./hello
4040
```
4141

42+
## Linking
43+
44+
This target selects `rust-lld` by default. Another option to use is
45+
[eld](https://github.com/qualcomm/eld), which is also provided with
46+
the opensource hexagon toolchain and the Hexagon SDK.
47+
4248
## Building the target
4349
Because it is Tier 3, rust does not yet ship pre-compiled artifacts for this
4450
target.

src/doc/rustc/src/platform-support/hexagon-unknown-none-elf.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ Functions marked `extern "C"` use the [Hexagon architecture calling convention](
2525

2626
This target generates PIC ELF binaries.
2727

28+
## Linking
29+
30+
This target selects `rust-lld` by default. Another option to use is
31+
[eld](https://github.com/qualcomm/eld), which is also provided with
32+
[the opensource hexagon toolchain](https://github.com/quic/toolchain_for_hexagon)
33+
and the Hexagon SDK.
34+
2835
## Building the target
2936

3037
You can build Rust with support for the target by adding it to the `target`

0 commit comments

Comments
 (0)