Skip to content

Conversation

@jonathanpallant
Copy link
Contributor

New Tier 3 targets - aarch64v8r-unknown-none and aarch64v8r-unknown-none-softfloat

This PR adds two new Tier 3 targets - aarch64v8r-unknown-none and aarch64v8r-unknown-none-softfloat.

The existing aarch64-unknown-none target assumes Armv8.0-A as a baseline. However, Arm recently released the Arm Cortex-R82 processor which is the first to implement the Armv8-R AArch64 mode architecture. This architecture is similar to Armv8-A AArch64, however it has a different set of mandatory features, and is based off of Armv8.4. It is largely unrelated to the existing Armv8-R architecture target (armv8r-none-eabihf), which only operates in AArch32 mode.

The second aarch64v8r-unknown-none-softfloat target allows for possible Armv8-R AArch64 CPUs with no FPU, or for use-cases where FPU register stacking is not desired. As with the existing aarch64-unknown-none target we have coupled FPU support and Neon support together - there is no 'has FPU but does not have NEON' target proposed even though the architecture technically allows for it.

These targets are in support of firmware development on upcoming systems using the Arm Cortex-R82, particularly safety-critical firmware development. For now, it can be tested using the Arm's Armv8-R AArch64 Fixed Virtual Platform emulator, which we have used to test this target. We are also in the process of testing this target with the full compiler test suite as part of Ferrocene, in the same way we test aarch64-unknown-none to a safety-qualified standard. We have not identified any issues as yet, but if we do, we will send the fixes upstream to you.

Ownership

This PR was developed by Ferrous Systems on behalf of Arm. Arm is the owner of these changes.

Tier 3 Policy Notes

To cover off the Tier 3 requirements:

A tier 3 target must have a designated developer or developers

Arm will maintain this target, and I have presumed the Embedded Devices Working Group will also take an interest, as they maintain the existing Arm bare-metal targets.

Targets must use naming consistent with any existing targets

We prefix this target with aarch64 because it generates A64 machine code (like arm* generates A32 and thumb* generates T32). In an ideal world I'd get to rename the existing target aarch64v8a-unknown-none but that's basically impossible at this point. You can assume v6 for any arm* target where unspecified, and you can assume v8a for any aarch64* target where not specified.

Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

It works just like the existing AArch64 bare-metal target.

Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.

Noted.

Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate.

It's a bare-metal target, offering libcore and liballoc.

The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible.

Done

Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target.

AArch64 is a Tier 1 architecture, so I don't expect this target to cause any issues.

Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

Noted.

Tier 3 targets must be able to produce assembly using at least one of rustc's supported backends from any host target.

It's AArch64 and so works with LLVM.

@rustbot
Copy link
Collaborator

rustbot commented Jan 9, 2026

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

cc @Noratrieb

Some changes occurred in tests/codegen-llvm/sanitizer

cc @rcvalle

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

@rustbot rustbot added PG-exploit-mitigations Project group: Exploit mitigations 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 Jan 9, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 9, 2026

r? @lcnr

rustbot has assigned @lcnr.
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

@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@jonathanpallant
Copy link
Contributor Author

jonathanpallant commented Jan 9, 2026

Ah, we've accidentally made tidy sad. Pinging @japaric to take a look at those failures.

@davidtwco
Copy link
Member

r? @wesleywiser

@rustbot rustbot assigned wesleywiser and unassigned lcnr Jan 9, 2026
@rustbot rustbot added the A-tidy Area: The tidy tool label Jan 9, 2026
@rust-log-analyzer

This comment has been minimized.

stack_probes: StackProbeType::Inline,
panic_strategy: PanicStrategy::Abort,
default_uwtable: true,

Copy link
Member

Choose a reason for hiding this comment

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

Given the discussion around #149622, I wonder if these targets should be added with

Suggested change
position_independent_executables: true,
static_position_independent_executables: true,

since the consensus seemed to be that it would make sense for our existing aarch64 targets to be configured that way except it could break people already using the targets.

Copy link
Contributor Author

@jonathanpallant jonathanpallant Jan 15, 2026

Choose a reason for hiding this comment

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

We tried that and things broke (IIRC), so we wanted to (or you to) fix all the breakages in the existing target before we flipped that switch.

Copy link
Contributor

Choose a reason for hiding this comment

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

We tried that and things broke (IIRC),

On this specfic point, as far as I could test the patch in #149622 breaks existing aarch64-unknown-none code that uses the aarch64-rt and/or the semihosting crate. This can be observed in this example: QEMU hangs and no output is printed; but the behavior can be observed in simpler programs as well.

As the AArch64 v8-R ISA builds on top of the Armv8.4-A ISA taking that patch has the same effect on this target.

Copy link
Member

Choose a reason for hiding this comment

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

I don't currently have cycles to drive that work so I don't want to block this on it.

@jonathanpallant
Copy link
Contributor Author

jonathanpallant commented Jan 15, 2026

There are comments above about "should this target include the changes in #149622".

Reasons we should do this

  • We wouldn't have to change this target later when #149622 merges, potentially causing breakage.

Reasons we should not do this

  • Those changes may require changes in third-party crates (e.g. aarch64-rt)
  • Applying those changes here when #149622 isn't merged would mean that two similar AArch64 bare-metal targets operate quite differently, which might cause confusion

My Proposal

We merge this target as-is, and we adjust #149622 to also patch these target, keeping them in sync. We can then work out what third-party crate changes are required and fix all four targets at the same time. The downside that this target would be static initially and change to be relocatable later will affect only a small number of people, and as the target is Tier 3 it can be subject to these kinds of changes anyway. Whatever announcements are made for the aarch64-unknown-none target when it changes can also just mention this target.

jonathanpallant added a commit to ferrocene/ferrocene that referenced this pull request Jan 19, 2026
…n-none-softfloat

This change adds testing of upstream targets named above. It should be applied after rust-lang/rust#150863 is merged upstream and pulled down via PR rotation.

The aarch64v8r-unknown-none target should be offered at the Supported Targets tier, because it is qualification ready and has been observed to pass the qualification test suite.

The aarch64v8r-unknown-none-softfloat target should be offered at the Experimental Targets tier, because it is not qualification ready and the test suite is not currently executable for this target due to incompatibilities between the soft-float ABI and our test running library.

This PR was developed by Ferrous Systems on behalf of Arm. Arm is the owner of these changes.
jonathanpallant added a commit to ferrocene/rust that referenced this pull request Jan 19, 2026
This PR adds checks to the `aarch64v8r-unknown-none` target to verify that if the Cortex-R82 CPU is enabled (with `-Ctarget-cpu=cortex-r82`), that the appropriate additional AArch64 features are enabled.

This is important because Cortex-R82 is (currently) the only processor implementing Armv8-R AArch64 and it implements a number of Armv8 features over and above the baseline for the architecture. Many of these features are of interest to safety-critical firmware development (for example `FEAT_RASv1p1`, which adds support for the *RAS Common Fault Injection Model Extension*) and so we anticipate them being enabled when building such firmware.

We are offering these tests upstream in-lieu of a full Cortex-R82 specific target because we understand the Project has a preference for architecture-baseline targets over CPU-specific targets.

This PR builds on and requires rust-lang#150863, but we've pulled them out as a separate PR.

This PR was developed by Ferrous Systems on behalf of Arm. Arm is the owner of these changes.
jonathanpallant added a commit to ferrocene/ferrocene that referenced this pull request Jan 19, 2026
…n-none-softfloat

This change adds testing of upstream targets named above. It should be applied after rust-lang/rust#150863 is merged upstream and pulled down via PR rotation.

The aarch64v8r-unknown-none target should be offered at the Supported Targets tier, because it is qualification ready and has been observed to pass the qualification test suite.

The aarch64v8r-unknown-none-softfloat target should be offered at the Experimental Targets tier, because it is not qualification ready and the test suite is not currently executable for this target due to incompatibilities between the soft-float ABI and our test running library.

This PR was developed by Ferrous Systems on behalf of Arm. Arm is the owner of these changes.
@rust-bors

This comment has been minimized.

@workingjubilee workingjubilee added the O-AArch64 Armv8-A or later processors in AArch64 mode label Jan 20, 2026
@jonathanpallant
Copy link
Contributor Author

The EDWG consented to maintainership in rust-embedded/wg#892.

@rustbot
Copy link
Collaborator

rustbot commented Jan 22, 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.

jonathanpallant added a commit to ferrocene/rust that referenced this pull request Jan 22, 2026
This PR adds checks to the `aarch64v8r-unknown-none` target to verify that if the Cortex-R82 CPU is enabled (with `-Ctarget-cpu=cortex-r82`), that the appropriate additional AArch64 features are enabled.

This is important because Cortex-R82 is (currently) the only processor implementing Armv8-R AArch64 and it implements a number of Armv8 features over and above the baseline for the architecture. Many of these features are of interest to safety-critical firmware development (for example `FEAT_RASv1p1`, which adds support for the *RAS Common Fault Injection Model Extension*) and so we anticipate them being enabled when building such firmware.

We are offering these tests upstream in-lieu of a full Cortex-R82 specific target because we understand the Project has a preference for architecture-baseline targets over CPU-specific targets.

This PR builds on and requires rust-lang#150863, but we've pulled them out as a separate PR.

This PR was developed by Ferrous Systems on behalf of Arm. Arm is the owner of these changes.
Copy link
Member

@wesleywiser wesleywiser left a comment

Choose a reason for hiding this comment

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

r=me with commits squashed

View changes since this review

…8r-unknown-none-softfloat`.

The existing `aarch64-unknown-none` target assumes Armv8.0-A as a baseline. However, Arm recently released the Arm Cortex-R82 processor which is the first to implement the Armv8-R AArch64 mode architecture. This architecture is similar to Armv8-A AArch64, however it has a different set of mandatory features, and is based off of Armv8.4. It is largely unrelated to the existing Armv8-R architecture target (`armv8r-none-eabihf`), which only operates in AArch32 mode.

The second `aarch64v8r-unknown-none-softfloat` target allows for possible Armv8-R AArch64 CPUs with no FPU, or for use-cases where FPU register stacking is not desired. As with the existing `aarch64-unknown-none` target we have coupled FPU support and Neon support together - there is no 'has FPU but does not have NEON' target proposed even though the architecture technically allows for it.

This PR was developed by Ferrous Systems on behalf of Arm. Arm is the owner of these changes.
@japaric japaric force-pushed the add-aarch64v8r-targets branch from 3eefca1 to 5cf807e Compare January 23, 2026 09:24
@japaric
Copy link
Contributor

japaric commented Jan 23, 2026

@wesleywiser commits have been squashed

japaric pushed a commit to ferrocene/rust that referenced this pull request Jan 23, 2026
This PR adds checks to the `aarch64v8r-unknown-none` target to verify that if the Cortex-R82 CPU is enabled (with `-Ctarget-cpu=cortex-r82`), that the appropriate additional AArch64 features are enabled.

This is important because Cortex-R82 is (currently) the only processor implementing Armv8-R AArch64 and it implements a number of Armv8 features over and above the baseline for the architecture. Many of these features are of interest to safety-critical firmware development (for example `FEAT_RASv1p1`, which adds support for the *RAS Common Fault Injection Model Extension*) and so we anticipate them being enabled when building such firmware.

We are offering these tests upstream in-lieu of a full Cortex-R82 specific target because we understand the Project has a preference for architecture-baseline targets over CPU-specific targets.

This PR builds on and requires rust-lang#150863, but we've pulled them out as a separate PR.

This PR was developed by Ferrous Systems on behalf of Arm. Arm is the owner of these changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tidy Area: The tidy tool O-AArch64 Armv8-A or later processors in AArch64 mode PG-exploit-mitigations Project group: Exploit mitigations 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants