Skip to content

Commit 36ab4ec

Browse files
authored
Rollup merge of #99227 - Lokathor:fix-thumbv4t-none-eabi-frame-pointer, r=davidtwco
Fix thumbv4t-none-eabi frame pointer setting The `thumb_base` profile has changed since I last remember seeing it, and now it sets the frame pointer to "always keep", which is not desired for this target. Hooking a debugger to the running program is not really done, it's preferable to have the register available for actual program use, so the default "may omit" is now set. I thought that the target was already using "may omit" when I checked on it last month, because I forgot that the target was previously based on `thumb_base` rather than `Default::default()`. I only noticed the issue just now when creating the `armv4t-none-eabi` target (#99226), though this PR is not in any way conditional on that one.
2 parents 3924dac + 2eac6f3 commit 36ab4ec

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,21 @@
44
//!
55
//! Please ping @Lokathor if changes are needed.
66
//!
7-
//! This target profile assumes that you have the ARM binutils in your path (specifically the linker, `arm-none-eabi-ld`). They can be obtained for free for all major OSes from the ARM developer's website, and they may also be available in your system's package manager. Unfortunately, the standard linker that Rust uses (`lld`) only supports as far back as `ARMv5TE`, so we must use the GNU `ld` linker.
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.
813
//!
9-
//! **Important:** This target profile **does not** specify a linker script. You just get the default link script when you build a binary for this target. The default link script is very likely wrong, so you should use `-Clink-arg=-Tmy_script.ld` to override that with a correct linker script.
14+
//! **Important:** This target profile **does not** specify a linker script. You
15+
//! just get the default link script when you build a binary for this target.
16+
//! The default link script is very likely wrong, so you should use
17+
//! `-Clink-arg=-Tmy_script.ld` to override that with a correct linker script.
1018
11-
use crate::spec::{cvs, LinkerFlavor, Target, TargetOptions};
19+
use crate::spec::{
20+
cvs, FramePointer, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetOptions,
21+
};
1222

1323
pub fn target() -> Target {
1424
Target {
@@ -39,6 +49,14 @@ pub fn target() -> Target {
3949
// minimum extra features, these cannot be disabled via -C
4050
features: "+soft-float,+strict-align".into(),
4151

52+
panic_strategy: PanicStrategy::Abort,
53+
relocation_model: RelocModel::Static,
54+
// suggested from thumb_base, rust-lang/rust#44993.
55+
emit_debug_gdb_scripts: false,
56+
// suggested from thumb_base, with no-os gcc/clang use 8-bit enums
57+
c_enum_min_bits: 8,
58+
frame_pointer: FramePointer::MayOmit,
59+
4260
main_needs_argc_argv: false,
4361

4462
// don't have atomic compare-and-swap

0 commit comments

Comments
 (0)