Skip to content
5 changes: 4 additions & 1 deletion src/doc/rustc/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,17 @@
- [\*-apple-visionos](platform-support/apple-visionos.md)
- [aarch64-nintendo-switch-freestanding](platform-support/aarch64-nintendo-switch-freestanding.md)
- [aarch64-unknown-linux-musl](platform-support/aarch64-unknown-linux-musl.md)
- [aarch64-unknown-none*](platform-support/aarch64-unknown-none.md)
- [aarch64_be-unknown-none-softfloat](platform-support/aarch64_be-unknown-none-softfloat.md)
- [aarch64_be-unknown-linux-musl](platform-support/aarch64_be-unknown-linux-musl.md)
- [amdgcn-amd-amdhsa](platform-support/amdgcn-amd-amdhsa.md)
- [armeb-unknown-linux-gnueabi](platform-support/armeb-unknown-linux-gnueabi.md)
- [arm-none-eabi](platform-support/arm-none-eabi.md)
- [armv4t-none-eabi](platform-support/armv4t-none-eabi.md)
- [armv5te-none-eabi](platform-support/armv5te-none-eabi.md)
- [armv7r-none-eabi](platform-support/armv7r-none-eabi.md)
- [armv7a-none-eabi{,hf}](platform-support/armv7a-none-eabi.md)
- [armv7r-none-eabi{,hf}](platform-support/armv7r-none-eabi.md)
- [armebv7r-none-eabi{,hf}](platform-support/armebv7r-none-eabi.md)
- [armv8r-none-eabihf](platform-support/armv8r-none-eabihf.md)
- [thumbv6m-none-eabi](./platform-support/thumbv6m-none-eabi.md)
- [thumbv7em-none-eabi\*](./platform-support/thumbv7em-none-eabi.md)
Expand Down
10 changes: 5 additions & 5 deletions src/doc/rustc/src/platform-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,22 +149,22 @@ target | std | notes
[`aarch64-apple-ios-sim`](platform-support/apple-ios.md) | ✓ | Apple iOS Simulator on ARM64
[`aarch64-linux-android`](platform-support/android.md) | ✓ | ARM64 Android
[`aarch64-unknown-fuchsia`](platform-support/fuchsia.md) | ✓ | ARM64 Fuchsia
`aarch64-unknown-none` | * | Bare ARM64, hardfloat
`aarch64-unknown-none-softfloat` | * | Bare ARM64, softfloat
[`aarch64-unknown-none`](platform-support/aarch64-unknown-none.md) | * | Bare ARM64, hardfloat
[`aarch64-unknown-none-softfloat`](platform-support/aarch64-unknown-none.md) | * | Bare ARM64, softfloat
[`aarch64-unknown-uefi`](platform-support/unknown-uefi.md) | ? | ARM64 UEFI
[`arm-linux-androideabi`](platform-support/android.md) | ✓ | Armv6 Android
`arm-unknown-linux-musleabi` | ✓ | Armv6 Linux with musl 1.2.3
`arm-unknown-linux-musleabihf` | ✓ | Armv6 Linux with musl 1.2.3, hardfloat
[`arm64ec-pc-windows-msvc`](platform-support/arm64ec-pc-windows-msvc.md) | ✓ | Arm64EC Windows MSVC
[`armebv7r-none-eabi`](platform-support/armv7r-none-eabi.md) | * | Bare Armv7-R, Big Endian
[`armebv7r-none-eabihf`](platform-support/armv7r-none-eabi.md) | * | Bare Armv7-R, Big Endian, hardfloat
[`armebv7r-none-eabi`](platform-support/armebv7r-none-eabi.md) | * | Bare Armv7-R, Big Endian
[`armebv7r-none-eabihf`](platform-support/armebv7r-none-eabi.md) | * | Bare Armv7-R, Big Endian, hardfloat
[`armv5te-unknown-linux-gnueabi`](platform-support/armv5te-unknown-linux-gnueabi.md) | ✓ | Armv5TE Linux (kernel 4.4+, glibc 2.23)
`armv5te-unknown-linux-musleabi` | ✓ | Armv5TE Linux with musl 1.2.3
[`armv7-linux-androideabi`](platform-support/android.md) | ✓ | Armv7-A Android
`armv7-unknown-linux-gnueabi` | ✓ | Armv7-A Linux (kernel 4.15+, glibc 2.27)
`armv7-unknown-linux-musleabi` | ✓ | Armv7-A Linux with musl 1.2.3
`armv7-unknown-linux-musleabihf` | ✓ | Armv7-A Linux with musl 1.2.3, hardfloat
[`armv7a-none-eabi`](platform-support/arm-none-eabi.md) | * | Bare Armv7-A
[`armv7a-none-eabi`](platform-support/armv7a-none-eabi.md) | * | Bare Armv7-A
[`armv7r-none-eabi`](platform-support/armv7r-none-eabi.md) | * | Bare Armv7-R
[`armv7r-none-eabihf`](platform-support/armv7r-none-eabi.md) | * | Bare Armv7-R, hardfloat
`i586-unknown-linux-gnu` | ✓ | 32-bit Linux (kernel 3.2+, glibc 2.17, original Pentium) [^x86_32-floats-x87]
Expand Down
78 changes: 78 additions & 0 deletions src/doc/rustc/src/platform-support/aarch64-unknown-none.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# `aarch64-unknown-none` and `aarch64-unknown-none-softfloat`

* **Tier: 2**
* **Library Support:** core and alloc (bare-metal, `#![no_std]`)

Bare-metal targets for CPUs in the Armv8-A architecture family, running in AArch64 mode.

For the AArch32 mode carried over from Armv7-A, see
[`armv7a-none-eabi`](armv7a-none-eabi.md) instead.

Processors in this family include the [Arm Cortex-A35, 53, 76, etc][aarch64-cpus].

[aarch64-cpus]: https://en.wikipedia.org/wiki/Comparison_of_ARM_processors#ARMv8-A

## Target maintainers

[Rust Embedded Devices Working Group Arm Team]

[Rust Embedded Devices Working Group Arm Team]: https://github.com/rust-embedded/wg?tab=readme-ov-file#the-arm-team

## Target CPU and Target Feature options

All AArch64 processors include an FPU. The difference between the `-none` and
`-none-softfloat` targets is whether the FPU is used for passing function arguments.
You may prefer the `-softfloat` target when writing a kernel or interfacing with
pre-compiled binaries that use the soft-float ABI.

When using the hardfloat targets, the minimum floating-point features assumed
are those of the `fp-armv8`, which excludes NEON SIMD support. If your
processor supports a different set of floating-point features than the default
expectations of `fp-armv8`, then these should also be enabled or disabled as
needed with `-C target-feature=(+/-)`. It is also possible to tell Rust (or
LLVM) that you have a specific model of Arm processor, using the
[`-Ctarget-cpu`][target-cpu] option. Doing so may change the default set of
target-features enabled.

[target-cpu]: https://doc.rust-lang.org/rustc/codegen-options/index.html#target-cpu
[target-feature]: https://doc.rust-lang.org/rustc/codegen-options/index.html#target-feature

## Requirements

These targets are cross-compiled and use static linking.

By default, the `lld` linker included with Rust will be used; however, you may
want to use the GNU linker instead. This can be obtained for Windows/Mac/Linux
from the [Arm Developer Website][arm-gnu-toolchain], or possibly from your OS's
package manager. To use it, add the following to your `.cargo/config.toml`:

```toml
[target.aarch64-unknown-none]
linker = "aarch64-none-elf-ld"
```

The GNU linker can also be used by specifying `aarch64-none-elf-gcc` as the
linker. This is needed when using GCC's link time optimization.

These targets don't provide a linker script, so you'll need to bring your own
according to the specific device you are using. Pass
`-Clink-arg=-Tyour_script.ld` as a rustc argument to make the linker use
`your_script.ld` during linking.

[arm-gnu-toolchain]: https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain

## Cross-compilation toolchains and C code

This target supports C code compiled with the `aarch64-none-elf` target
triple and a suitable `-march` or `-mcpu` flag.

## Start-up and Low-Level Code

The [Rust Embedded Devices Working Group Arm Team] maintain the
[`aarch64-cpu`] crate, which may be useful for writing bare-metal code using
this target.

The *TrustedFirmware* group also maintain [Rust crates for this
target](https://github.com/ArmFirmwareCrates).

[`aarch64-cpu`]: https://docs.rs/aarch64-cpu
Comment on lines +69 to +78
Copy link
Contributor

@Gelbpunkt Gelbpunkt Sep 12, 2025

Choose a reason for hiding this comment

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

I'm not really sure how the maintainers feel about endorsing third-party crates like this. I think this section could just be dropped and, if you really want to have some start-up code, replaced with a tiny linker script + assembly + Rust entrypoint example when e.g. booting with the Linux boot protocol.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For many targets the code required is more than can fit into a target doc, and often involves multiple files that would be tedious and error prone to copy-paste into a new project. ArmFirmwareCrates is from Arm themselves, so it seemed legit to refer to it. But I can take it out.

I personally find it pretty hard to get started with many of these targets so I think giving people links to code that works and runs is very useful. I’m happy to not have it here, but I don’t know where else it would go.

Copy link
Member

Choose a reason for hiding this comment

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

For a target, if the maintainers think it worthwhile to recommend a crate that deals with the special needs of that target, then we generally do not impede such. Often, external software is required anyways for a target, e.g. specialty linkers or compilers or headers or... whatever. If quite a lot of such supplemental material is needed, it may come as an advisory against maintaining the target at all, but this doesn't seem to rise to such a threshold.

6 changes: 3 additions & 3 deletions src/doc/rustc/src/platform-support/arm-none-eabi.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ their own document.
### Tier 2 Target List

- Arm A-Profile Architectures
- `armv7a-none-eabi`
- [`armv7a-none-eabi`](armv7a-none-eabi.md)
- Arm R-Profile Architectures
- [`armv7r-none-eabi` and `armv7r-none-eabihf`](armv7r-none-eabi.md)
- [`armebv7r-none-eabi` and `armebv7r-none-eabihf`](armv7r-none-eabi.md)
- [`armebv7r-none-eabi` and `armebv7r-none-eabihf`](armebv7r-none-eabi.md)
- Arm M-Profile Architectures
- [`thumbv6m-none-eabi`](thumbv6m-none-eabi.md)
- [`thumbv7m-none-eabi`](thumbv7m-none-eabi.md)
Expand All @@ -28,7 +28,7 @@ their own document.
### Tier 3 Target List

- Arm A-Profile Architectures
- `armv7a-none-eabihf`
- [`armv7a-none-eabihf`](armv7a-none-eabi.md)
- Arm R-Profile Architectures
- [`armv8r-none-eabihf`](armv8r-none-eabihf.md)
- Arm M-Profile Architectures
Expand Down
55 changes: 55 additions & 0 deletions src/doc/rustc/src/platform-support/armebv7r-none-eabi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# `armebv7r-none-eabi` and `armebv7r-none-eabihf`

* **Tier: 2**
* **Library Support:** core and alloc (bare-metal, `#![no_std]`)

Bare-metal target for CPUs in the Armv7-R architecture family running in Big
Endian mode. These processors support dual ARM/Thumb mode, with ARM mode as
the default.

**NOTE:** You should almost always prefer the [little-endian
versions](armv7r-none-eabi.md) of these target. Big Endian Arm systems are
highly unusual.

Processors in this family include the [Arm Cortex-R4, 5, 7, and 8][cortex-r].

See [`arm-none-eabi`](arm-none-eabi.md) for information applicable to all
`arm-none-eabi` targets.

[cortex-r]: https://en.wikipedia.org/wiki/ARM_Cortex-R

## Target maintainers

[@chrisnc](https://github.com/chrisnc)

## Requirements

Note that some variants of the Cortex-R have both big-endian instructions and
data. This configuration is known as BE-32, while data-only big-endianness is
known as BE-8. To build programs for BE-32 processors, the GNU linker must be
used with the `-mbe32` option. See [ARM Cortex-R Series Programmer's Guide:
Endianness][endianness] for more details about different endian modes.

When using the hardfloat targets, the minimum floating-point features assumed
are those of the `vfpv3-d16`, which includes single- and double-precision, with
16 double-precision registers. This floating-point unit appears in Cortex-R4F
and Cortex-R5F processors. See [VFP in the Cortex-R processors][vfp]
for more details on the possible FPU variants.

If your processor supports a different set of floating-point features than the
default expectations of `vfpv3-d16`, then these should also be enabled or
disabled as needed with `-C target-feature=(+/-)`.

[endianness]: https://developer.arm.com/documentation/den0042/a/Coding-for-Cortex-R-Processors/Endianness

[vfp]: https://developer.arm.com/documentation/den0042/a/Floating-Point/Floating-point-basics-and-the-IEEE-754-standard/VFP-in-the-Cortex-R-processors

## Start-up and Low-Level Code

The [Rust Embedded Devices Working Group Arm Team] maintain the [`cortex-ar`]
and [`cortex-r-rt`] crates, which may be useful for writing bare-metal code
using this target. Those crates include several examples which run in QEMU and
build using these targets.

[`cortex-ar`]: https://docs.rs/cortex-ar
[`cortex-r-rt`]: https://docs.rs/cortex-r-rt
3 changes: 2 additions & 1 deletion src/doc/rustc/src/platform-support/armv4t-none-eabi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# armv4t-none-eabi / thumbv4t-none-eabi

Tier 3
* **Tier: 3**
* **Library Support:** core and alloc (bare-metal, `#![no_std]`)

These two targets are part of the [`arm-none-eabi`](arm-none-eabi.md) target
group, and all the information there applies.
Expand Down
3 changes: 2 additions & 1 deletion src/doc/rustc/src/platform-support/armv5te-none-eabi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# `armv5te-none-eabi`

**Tier: 3**
* **Tier: 3**
* **Library Support:** core and alloc (bare-metal, `#![no_std]`)

Bare-metal target for any cpu in the Armv5TE architecture family, supporting
ARM/Thumb code interworking (aka `A32`/`T32`), with `A32` code as the default code
Expand Down
70 changes: 70 additions & 0 deletions src/doc/rustc/src/platform-support/armv7a-none-eabi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# `armv7a-none-eabi` and `armv7a-none-eabihf`

* **Tier: 2** for `armv7a-none-eabi`
* **Tier: 3** for `armv7a-none-eabihf`
* **Library Support:** core and alloc (bare-metal, `#![no_std]`)

Bare-metal target for CPUs in the Armv7-A architecture family, supporting
dual ARM/Thumb mode, with ARM mode as the default.

Note, this is for processors running in AArch32 mode. For the AArch64 mode
added in Armv8-A, see [`aarch64-unknown-none`](aarch64-unknown-none.md) instead.

Processors in this family include the [Arm Cortex-A5, 8, 32, etc][cortex-a].

See [`arm-none-eabi`](arm-none-eabi.md) for information applicable to all
`arm-none-eabi` targets.

[cortex-a]: https://en.wikipedia.org/wiki/ARM_Cortex-A

## Target maintainers

[Rust Embedded Devices Working Group Arm Team]

[Rust Embedded Devices Working Group Arm Team]: https://github.com/rust-embedded/wg?tab=readme-ov-file#the-arm-team

## Requirements

Almost all Armv7-A processors include an FPU (a VFPv3 or a VFPv4). The
difference between the `-eabi` and `-eabihf` targets is whether the FPU is
used for passing function arguments. You may prefer the `-eabi` soft-float
target when the processor does not have a floating point unit or the compiled
code should not use the floating point unit.

When using the hardfloat targets, the minimum floating-point features assumed
are those of the VFPv3-D16, which includes single- and double-precision, with
16 double-precision registers. This floating-point unit appears in Cortex-A8
and Cortex-A9 processors. See [VFP in the Cortex-A processors][vfp] for more
details on the possible FPU variants.

If your processor supports a different set of floating-point features than the
default expectations of VFPv3-D16, then these should also be enabled or
disabled as needed with `-C target-feature=(+/-)`.

In general, the following four combinations are possible:

- VFPv3-D16, target feature `+vfp3` and `-d32`
- VFPv3-D32, target feature `+vfp3` and `+d32`
- VFPv4-D16, target feature `+vfp4` and `-d32`
- VFPv4-D32, target feature `+vfp4` and `+d32`

An Armv7-A processor may optionally include a NEON hardware unit which
provides Single Instruction Multiple Data (SIMD) operations. The
implementation of this unit implies VFPv3-D32. The target feature `+neon` may
be added to inform the compiler about the availability of NEON.

You can refer to the [arm-none-eabi](arm-none-eabi.md) documentation for a
generic guide on target feature and target CPU specification and how to enable
and disable them via `.cargo/config.toml` file.

[vfp]: https://developer.arm.com/documentation/den0013/0400/Floating-Point/Floating-point-basics-and-the-IEEE-754-standard/ARM-VFP

## Start-up and Low-Level Code

The [Rust Embedded Devices Working Group Arm Team] maintain the [`cortex-ar`]
and [`cortex-a-rt`] crates, which may be useful for writing bare-metal code
using this target. The [`cortex-ar` repository](https://github.com/rust-embedded/cortex-ar)
includes several examples which run in QEMU and build using these targets.

[`cortex-ar`]: https://docs.rs/cortex-ar
[`cortex-a-rt`]: https://docs.rs/cortex-a-rt
28 changes: 14 additions & 14 deletions src/doc/rustc/src/platform-support/armv7r-none-eabi.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# `arm(eb)?v7r-none-eabi(hf)?`
# `armv7r-none-eabi` and `armv7r-none-eabihf`

**Tier: 2**
* **Tier: 2**
* **Library Support:** core and alloc (bare-metal, `#![no_std]`)

Bare-metal target for CPUs in the Armv7-R architecture family, supporting
dual ARM/Thumb mode, with ARM mode as the default.

Processors in this family include the [Arm Cortex-R4, 5, 7, and 8][cortex-r].

The `eb` versions of this target generate code for big-endian processors.

See [`arm-none-eabi`](arm-none-eabi.md) for information applicable to all
`arm-none-eabi` targets.

Expand All @@ -17,15 +16,11 @@ See [`arm-none-eabi`](arm-none-eabi.md) for information applicable to all
## Target maintainers

[@chrisnc](https://github.com/chrisnc)
[Rust Embedded Devices Working Group Arm Team]

## Requirements
[Rust Embedded Devices Working Group Arm Team]: https://github.com/rust-embedded/wg?tab=readme-ov-file#the-arm-team

When using the big-endian version of this target, note that some variants of
the Cortex-R have both big-endian instructions and data. This configuration is
known as BE-32, while data-only big-endianness is known as BE-8. To build
programs for BE-32 processors, the GNU linker must be used with the `-mbe32`
option. See [ARM Cortex-R Series Programmer's Guide: Endianness][endianness]
for more details about different endian modes.
## Requirements

When using the hardfloat targets, the minimum floating-point features assumed
are those of the `vfpv3-d16`, which includes single- and double-precision, with
Expand All @@ -41,7 +36,12 @@ disabled as needed with `-C target-feature=(+/-)`.

[vfp]: https://developer.arm.com/documentation/den0042/a/Floating-Point/Floating-point-basics-and-the-IEEE-754-standard/VFP-in-the-Cortex-R-processors

## Cross-compilation toolchains and C code
## Start-up and Low-Level Code

The [Rust Embedded Devices Working Group Arm Team] maintain the [`cortex-ar`]
and [`cortex-r-rt`] crates, which may be useful for writing bare-metal code
using this target. Those crates include several examples which run in QEMU and
build using these targets.

This target supports C code compiled with the `arm-none-eabi` target triple and
`-march=armv7-r` or a suitable `-mcpu` flag.
[`cortex-ar`]: https://docs.rs/cortex-ar
[`cortex-r-rt`]: https://docs.rs/cortex-r-rt
21 changes: 16 additions & 5 deletions src/doc/rustc/src/platform-support/armv8r-none-eabihf.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# `armv8r-none-eabihf`

**Tier: 3**
* **Tier: 3**
* **Library Support:** core and alloc (bare-metal, `#![no_std]`)

Bare-metal target for CPUs in the Armv8-R architecture family, supporting
dual ARM/Thumb mode, with ARM mode as the default.
Expand All @@ -17,6 +18,9 @@ See [`arm-none-eabi`](arm-none-eabi.md) for information applicable to all
## Target maintainers

[@chrisnc](https://github.com/chrisnc)
[Rust Embedded Devices Working Group Arm Team]

[Rust Embedded Devices Working Group Arm Team]: https://github.com/rust-embedded/wg?tab=readme-ov-file#the-arm-team

## Requirements

Expand All @@ -34,7 +38,14 @@ Technical Reference Manual for more details.

[fpu]: https://developer.arm.com/documentation/100026/0104/Advanced-SIMD-and-floating-point-support/About-the-Advanced-SIMD-and-floating-point-support

## Cross-compilation toolchains and C code

This target supports C code compiled with the `arm-none-eabi` target triple and
`-march=armv8-r` or a suitable `-mcpu` flag.
### Table of supported CPUs for `armv8r-none-eabihf`

| CPU | FPU | Neon | Target CPU | Target Features |
|:----------- | --- |:---- |:---------------- |:------------------ |
| Any | SP | No | None | None |
| Cortex-R52 | SP | No | `cortex-r52` | `-fp64,-d32,-neon` |
| Cortex-R52 | DP | No | `cortex-r52` | `-neon` |
| Cortex-R52 | DP | Yes | `cortex-r52` | None |
| Cortex-R52+ | SP | No | `cortex-r52plus` | `-fp64,-d32,-neon` |
| Cortex-R52+ | DP | No | `cortex-r52plus` | `-neon` |
| Cortex-R52+ | DP | Yes | `cortex-r52plus` | None |
Loading
Loading