Skip to content

Commit 3811275

Browse files
committed
Switch to LLD as default linker for {arm,thumb}v4t-none-eabi
1 parent f346fb0 commit 3811275

File tree

3 files changed

+3
-26
lines changed

3 files changed

+3
-26
lines changed

compiler/rustc_target/src/spec/armv4t_none_eabi.rs

+2-9
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@
44
//!
55
//! Please ping @Lokathor if changes are needed.
66
//!
7-
//! This target profile assumes that you have the ARM binutils in your path
8-
//! (specifically the linker, `arm-none-eabi-ld`). They can be obtained for free
9-
//! for all major OSes from the ARM developer's website, and they may also be
10-
//! available in your system's package manager. Unfortunately, the standard
11-
//! linker that Rust uses (`lld`) only supports as far back as `ARMv5TE`, so we
12-
//! must use the GNU `ld` linker.
13-
//!
147
//! **Important:** This target profile **does not** specify a linker script. You
158
//! just get the default link script when you build a binary for this target.
169
//! The default link script is very likely wrong, so you should use
@@ -35,8 +28,8 @@ pub fn target() -> Target {
3528
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
3629
options: TargetOptions {
3730
abi: "eabi".into(),
38-
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::No),
39-
linker: Some("arm-none-eabi-ld".into()),
31+
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
32+
linker: Some("rust-lld".into()),
4033
asm_args: cvs!["-mthumb-interwork", "-march=armv4t", "-mlittle-endian",],
4134
// Force-enable 32-bit atomics, which allows the use of atomic load/store only.
4235
// The resulting atomics are ABI incompatible with atomics backed by libatomic.

compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs

+1-10
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,12 @@
44
//!
55
//! Please ping @Lokathor if changes are needed.
66
//!
7-
//! This target profile assumes that you have the ARM binutils in your path
8-
//! (specifically the linker, `arm-none-eabi-ld`). They can be obtained for free
9-
//! for all major OSes from the ARM developer's website, and they may also be
10-
//! available in your system's package manager. Unfortunately, the standard
11-
//! linker that Rust uses (`lld`) only supports as far back as `ARMv5TE`, so we
12-
//! must use the GNU `ld` linker.
13-
//!
147
//! **Important:** This target profile **does not** specify a linker script. You
158
//! just get the default link script when you build a binary for this target.
169
//! The default link script is very likely wrong, so you should use
1710
//! `-Clink-arg=-Tmy_script.ld` to override that with a correct linker script.
1811
19-
use crate::spec::{cvs, Cc, FramePointer, LinkerFlavor, Lld};
12+
use crate::spec::{cvs, FramePointer};
2013
use crate::spec::{PanicStrategy, RelocModel, Target, TargetOptions};
2114

2215
pub fn target() -> Target {
@@ -36,8 +29,6 @@ pub fn target() -> Target {
3629
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
3730
options: TargetOptions {
3831
abi: "eabi".into(),
39-
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::No),
40-
linker: Some("arm-none-eabi-ld".into()),
4132

4233
// extra args passed to the external assembler (assuming `arm-none-eabi-as`):
4334
// * activate t32/a32 interworking

src/doc/rustc/src/platform-support/armv4t-none-eabi.md

-7
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ specific with this target, so any ARMv4T device should work fine.
1717

1818
The target is cross-compiled, and uses static linking.
1919

20-
The linker that comes with rustc cannot link for this platform (the platform is
21-
too old). You will need the `arm-none-eabi-ld` linker from a GNU Binutils
22-
targeting ARM. This can be obtained for Windows/Mac/Linux from the [ARM
23-
Developer Website][arm-dev], or possibly from your OS's package manager.
24-
25-
[arm-dev]: https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain
26-
2720
This target doesn't provide a linker script, you'll need to bring your own
2821
according to the specific device you want to target. Pass
2922
`-Clink-arg=-Tyour_script.ld` as a rustc argument to make the linker use

0 commit comments

Comments
 (0)