Skip to content

Conversation

@thejpster
Copy link
Contributor

We currently have targets for bare-metal Armv7-R, Armv7-A and Armv8-R, but only in Arm mode. This PR adds five new targets enabling bare-metal support on these architectures in Thumb mode.

This has been tested using https://github.com/rust-embedded/aarch32/compare/main...thejpster:aarch32:support-thumb-mode-v7-v8?expand=1 and they all seem to work as expected.

However, I wasn't sure what to do with the maintainer lists as these are five new targets, but they share the docs page with the existing Arm versions. I can ask the Embedded Devices WG Arm Team about taking on these ones too, but whether Arm themselves want to take them on I guess is a bigger question.

@rustbot
Copy link
Collaborator

rustbot commented Dec 31, 2025

Some changes occurred in src/doc/rustc/src/platform-support

cc @Noratrieb

These commits modify compiler targets.
(See the Target Tier Policy.)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 31, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 31, 2025

r? @fee1-dead

rustbot has assigned @fee1-dead.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@fee1-dead
Copy link
Member

@rustbot reroll

@rustbot rustbot assigned lcnr and unassigned fee1-dead Jan 1, 2026
@bors

This comment was marked as resolved.

@thejpster thejpster force-pushed the add-thumbv7a-thumbv7r-thumbv8r branch from a338091 to a556210 Compare January 1, 2026 17:16
@rustbot
Copy link
Collaborator

rustbot commented Jan 1, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@lcnr
Copy link
Contributor

lcnr commented Jan 19, 2026

wooops, sry

@bors compiler

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 19, 2026

Unknown command "compiler". Run @bors help to see available commands.

@lcnr
Copy link
Contributor

lcnr commented Jan 19, 2026

@rustbot reroll

@rustbot rustbot assigned petrochenkov and unassigned lcnr Jan 19, 2026
llvm_floatabi: Some(FloatAbi::Soft),
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
linker: Some("rust-lld".into()),
features: "+v7,+thumb2,+soft-float,-neon,+strict-align".into(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+v7,+thumb2 was lost, is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The feature flags were redundant as they are implied by the LLVM target name. The —print cfg output should be unchanged.

linker: Some("rust-lld".into()),
features: "+v7,+thumb2,+soft-float,-neon,+strict-align".into(),
relocation_model: RelocModel::Static,
disable_redzone: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disable_redzone was changed to false, is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think red zones apply to this architecture, so I made the setting the same as the other AArch32 targets.

linker: Some("rust-lld".into()),
features: "+v7,+vfp3d16,+thumb2,-neon,+strict-align".into(),
relocation_model: RelocModel::Static,
disable_redzone: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, features, disable_redzone and frame_pointer are different now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took out redundant flags and rationalised the options to match all the other targets.

features: "+soft-float,-neon,+strict-align".into(),
max_atomic_width: Some(64),
has_thumb_interworking: true,
..base::arm_none::opts()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, frame_pointer is now set to FramePointer::Always, is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Other AArch32 targets have frame pointers always on.

c_enum_min_bits: Some(8),
has_thumb_interworking: true,
..Default::default()
..base::arm_none::opts()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

frame_pointer changes here and in the other R targets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Other AArch32 targets have frame pointers always on.

llvm_floatabi: Some(FloatAbi::Soft),
features: "+soft-float,-neon,+strict-align".into(),
max_atomic_width: Some(64),
has_thumb_interworking: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does has_thumb_interworking make sense on thumb targets?
Most of them don't have it set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It enables the instruction_set attribute and AFAIK should be enabled on every target that supports both Arm mode and Thumb mode regardless of which is the default. The only AArch32 targets it shouldn’t apply to are the M-profile targets because they are Thumb-only.

if !cx.sess.target.has_thumb_interworking {

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 19, 2026
@rust-bors

This comment has been minimized.

@thejpster thejpster force-pushed the add-thumbv7a-thumbv7r-thumbv8r branch from 809a1a5 to fb05cac Compare January 22, 2026 18:37
@thejpster thejpster force-pushed the add-thumbv7a-thumbv7r-thumbv8r branch from 75afffe to fa526c4 Compare January 22, 2026 20:51
@thejpster
Copy link
Contributor Author

@petrochenkov - I've updated the docs as requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants