Skip to content

Commit faf0e14

Browse files
committed
Update the arm-* and aarch64-* platform docs.
The Rust Embedded Devices Working Group (wg-embedded) Arm Team (t-arm) agreed to listed as maintainers of: * aarch64-unknown-none * aarch64-unknown-none-softfloat * armv7a-none-eabi * armv7r-none-eabi * armv7r-none-eabihf The aarch64-unknown-none* target didn't have a page so I added it. wg-embedded t-arm did not want to take over: * armebv7r-none-eabi * armebv7r-none-eabihf So I gave them their own target page. The current maintainer remains.
1 parent 55b9b4d commit faf0e14

File tree

8 files changed

+264
-19
lines changed

8 files changed

+264
-19
lines changed

src/doc/rustc/src/SUMMARY.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,17 @@
4848
- [\*-apple-visionos](platform-support/apple-visionos.md)
4949
- [aarch64-nintendo-switch-freestanding](platform-support/aarch64-nintendo-switch-freestanding.md)
5050
- [aarch64-unknown-linux-musl](platform-support/aarch64-unknown-linux-musl.md)
51+
- [aarch64-unknown-none{,-softfloat}](aarch64-unknown-none.md)
5152
- [aarch64_be-unknown-none-softfloat](platform-support/aarch64_be-unknown-none-softfloat.md)
5253
- [aarch64_be-unknown-linux-musl](platform-support/aarch64_be-unknown-linux-musl.md)
5354
- [amdgcn-amd-amdhsa](platform-support/amdgcn-amd-amdhsa.md)
5455
- [armeb-unknown-linux-gnueabi](platform-support/armeb-unknown-linux-gnueabi.md)
5556
- [arm-none-eabi](platform-support/arm-none-eabi.md)
5657
- [armv4t-none-eabi](platform-support/armv4t-none-eabi.md)
5758
- [armv5te-none-eabi](platform-support/armv5te-none-eabi.md)
58-
- [armv7r-none-eabi](platform-support/armv7r-none-eabi.md)
59+
- [armv7a-none-eabi{,hf}](platform-support/armv7a-none-eabi.md)
60+
- [armv7r-none-eabi{,hf}](platform-support/armv7r-none-eabi.md)
61+
- [armebv7r-none-eabi{,hf}](platform-support/armebv7r-none-eabi.md)
5962
- [armv8r-none-eabihf](platform-support/armv8r-none-eabihf.md)
6063
- [thumbv6m-none-eabi](./platform-support/thumbv6m-none-eabi.md)
6164
- [thumbv7em-none-eabi\*](./platform-support/thumbv7em-none-eabi.md)

src/doc/rustc/src/platform-support.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,15 @@ target | std | notes
156156
`arm-unknown-linux-musleabi` | ✓ | Armv6 Linux with musl 1.2.3
157157
`arm-unknown-linux-musleabihf` | ✓ | Armv6 Linux with musl 1.2.3, hardfloat
158158
[`arm64ec-pc-windows-msvc`](platform-support/arm64ec-pc-windows-msvc.md) | ✓ | Arm64EC Windows MSVC
159-
[`armebv7r-none-eabi`](platform-support/armv7r-none-eabi.md) | * | Bare Armv7-R, Big Endian
160-
[`armebv7r-none-eabihf`](platform-support/armv7r-none-eabi.md) | * | Bare Armv7-R, Big Endian, hardfloat
159+
[`armebv7r-none-eabi`](platform-support/armebv7r-none-eabi.md) | * | Bare Armv7-R, Big Endian
160+
[`armebv7r-none-eabihf`](platform-support/armebv7r-none-eabi.md) | * | Bare Armv7-R, Big Endian, hardfloat
161161
[`armv5te-unknown-linux-gnueabi`](platform-support/armv5te-unknown-linux-gnueabi.md) | ✓ | Armv5TE Linux (kernel 4.4+, glibc 2.23)
162162
`armv5te-unknown-linux-musleabi` | ✓ | Armv5TE Linux with musl 1.2.3
163163
[`armv7-linux-androideabi`](platform-support/android.md) | ✓ | Armv7-A Android
164164
`armv7-unknown-linux-gnueabi` | ✓ | Armv7-A Linux (kernel 4.15+, glibc 2.27)
165165
`armv7-unknown-linux-musleabi` | ✓ | Armv7-A Linux with musl 1.2.3
166166
`armv7-unknown-linux-musleabihf` | ✓ | Armv7-A Linux with musl 1.2.3, hardfloat
167-
[`armv7a-none-eabi`](platform-support/arm-none-eabi.md) | * | Bare Armv7-A
167+
[`armv7a-none-eabi`](platform-support/armv7a-none-eabi.md) | * | Bare Armv7-A
168168
[`armv7r-none-eabi`](platform-support/armv7r-none-eabi.md) | * | Bare Armv7-R
169169
[`armv7r-none-eabihf`](platform-support/armv7r-none-eabi.md) | * | Bare Armv7-R, hardfloat
170170
`i586-unknown-linux-gnu` | ✓ | 32-bit Linux (kernel 3.2+, glibc 2.17, original Pentium) [^x86_32-floats-x87]
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# `aarch64-unknown-none`
2+
3+
**Tier: 2**
4+
5+
Bare-metal target for CPUs in the Armv8-A architecture family, running in AArch64 mode.
6+
7+
For the AArch32 mode carried over from Armv7-A, see
8+
[`armv7a-none-eabi`](armv7a-none-eabi.md) instead.
9+
10+
Processors in this family include the [Arm Cortex-A35, 53, 76, etc][aarch64-cpus].
11+
12+
[aarch64-cpus]: https://en.wikipedia.org/wiki/Comparison_of_ARM_processors#ARMv8-A
13+
14+
## Target maintainers
15+
16+
* [Rust Embedded Devices Working Group Arm Team]
17+
18+
[Rust Embedded Devices Working Group Arm Team]: https://github.com/rust-embedded/wg?tab=readme-ov-file#the-arm-team
19+
20+
## Target CPU and Target Feature options
21+
22+
It is possible to tell Rust (or LLVM) that you have a specific model of Arm
23+
processor, using the [`-Ctarget-cpu`][target-cpu] option. You can also control
24+
whether Rust (or LLVM) will include instructions that target optional hardware
25+
features, e.g. hardware floating-point, or Advanced SIMD operations, using
26+
[`-Ctarget-feature`][target-feature].
27+
28+
It is important to note that selecting a *target-cpu* will typically enable
29+
*all* the optional features available from Arm on that model of CPU and your
30+
particular implementation of that CPU may not have those features available.
31+
In that case, you can use `-Ctarget-feature=-option` to turn off the specific
32+
CPU features you do not have available, leaving you with the optimized
33+
instruction scheduling and support for the features you do have. More details
34+
are available in the detailed target-specific documentation.
35+
36+
<div class="warning">
37+
38+
Many target-features are currently unstable and subject to change, and
39+
if you use them you should disassemble the compiler output and manually inspect
40+
it to ensure only appropriate instructions for your CPU have been generated.
41+
42+
</div>
43+
44+
If you wish to use the *target-cpu* and *target-feature* options, you can add
45+
them to your `.cargo/config.toml` file alongside any other flags your project
46+
uses (likely linker related ones):
47+
48+
```toml
49+
rustflags = [
50+
# Usual Arm bare-metal linker setup
51+
"-Clink-arg=-Tlink.x",
52+
"-Clink-arg=--nmagic",
53+
# tell Rust we have a Cortex-A72
54+
"-Ctarget-cpu=cortex-a72",
55+
]
56+
57+
[build]
58+
target = "aarch64-unknown-none"
59+
```
60+
61+
[target-cpu]: https://doc.rust-lang.org/rustc/codegen-options/index.html#target-cpu
62+
[target-feature]: https://doc.rust-lang.org/rustc/codegen-options/index.html#target-feature
63+
64+
## Requirements
65+
66+
These targets are cross-compiled and use static linking.
67+
68+
By default, the `lld` linker included with Rust will be used; however, you may
69+
want to use the GNU linker instead. This can be obtained for Windows/Mac/Linux
70+
from the [Arm Developer Website][arm-gnu-toolchain], or possibly from your OS's
71+
package manager. To use it, add the following to your `.cargo/config.toml`:
72+
73+
```toml
74+
[target.<your-target>]
75+
linker = "arm-none-eabi-ld"
76+
```
77+
78+
The GNU linker can also be used by specifying `aarch64-none-gcc` as the
79+
linker. This is needed when using GCC's link time optimization.
80+
81+
These targets don't provide a linker script, so you'll need to bring your own
82+
according to the specific device you are using. Pass
83+
`-Clink-arg=-Tyour_script.ld` as a rustc argument to make the linker use
84+
`your_script.ld` during linking.
85+
86+
All AArch64 processors include an FPU. The difference between the `-none` and
87+
`-none-softfloat` targets is whether the FPU is used for passing function arguments.
88+
You may prefer the `-softfloat` target when writing a kernel or interfacing with
89+
pre-compiled binaries that use the soft-float ABI.
90+
91+
When using the hardfloat targets, the minimum floating-point features assumed
92+
are those of the `fp-armv8`, which excludes NEON SIMD support. If your
93+
processor supports a different set of floating-point features than the default
94+
expectations of `fp-armv8`, then these should also be enabled or disabled as
95+
needed with `-C target-feature=(+/-)`. For example,
96+
`-Ctarget-feature=+neon-fp-armv8`.
97+
98+
[arm-gnu-toolchain]: https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain
99+
100+
## Testing
101+
102+
This is a cross-compiled target that you will need to emulate during testing.
103+
104+
The exact emulator that you'll need depends on the specific device you want to
105+
run your code on.
106+
107+
## Start-up and Low-Level Code
108+
109+
The [Rust Embedded Devices Working Group Arm Team] maintain the
110+
[`aarch64-cpu`], which may be useful for writing bare-metal code using this
111+
target.
112+
113+
The *TrustedFirmware* group also maintain [Rust crates for this
114+
target](https://github.com/ArmFirmwareCrates).
115+
116+
[`aarch64-cpu`]: https://docs.rs/aarch64-cpu
117+
118+
## Cross-compilation toolchains and C code
119+
120+
This target supports C code compiled with the `aarch64-unknown-none` target
121+
triple and a suitable `-march` or `-mcpu` flag.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ their own document.
1212
### Tier 2 Target List
1313

1414
- Arm A-Profile Architectures
15-
- `armv7a-none-eabi`
15+
- [`armv7a-none-eabi`](armv7a-none-eabi.md)
1616
- Arm R-Profile Architectures
1717
- [`armv7r-none-eabi` and `armv7r-none-eabihf`](armv7r-none-eabi.md)
18-
- [`armebv7r-none-eabi` and `armebv7r-none-eabihf`](armv7r-none-eabi.md)
18+
- [`armebv7r-none-eabi` and `armebv7r-none-eabihf`](armebv7r-none-eabi.md)
1919
- Arm M-Profile Architectures
2020
- [`thumbv6m-none-eabi`](thumbv6m-none-eabi.md)
2121
- [`thumbv7m-none-eabi`](thumbv7m-none-eabi.md)
@@ -28,7 +28,7 @@ their own document.
2828
### Tier 3 Target List
2929

3030
- Arm A-Profile Architectures
31-
- `armv7a-none-eabihf`
31+
- [`armv7a-none-eabihf`](armv7a-none-eabi.md)
3232
- Arm R-Profile Architectures
3333
- [`armv8r-none-eabihf`](armv8r-none-eabihf.md)
3434
- Arm M-Profile Architectures
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# `armebv7r-none-eabi` and `armebv7r-none-eabihf`
2+
3+
**Tier: 2**
4+
5+
Bare-metal target for CPUs in the Armv7-R architecture family running in Big
6+
Endian mode. These processors support dual ARM/Thumb mode, with ARM mode as
7+
the default.
8+
9+
**NOTE:** You should almost always prefer the [little-endian
10+
versions](armv7r-none-eabi.md) of these target. Big Endian Arm systems are
11+
highly unusual.
12+
13+
Processors in this family include the [Arm Cortex-R4, 5, 7, and 8][cortex-r].
14+
15+
See [`arm-none-eabi`](arm-none-eabi.md) for information applicable to all
16+
`arm-none-eabi` targets.
17+
18+
[cortex-r]: https://en.wikipedia.org/wiki/ARM_Cortex-R
19+
20+
## Target maintainers
21+
22+
* [@chrisnc](https://github.com/chrisnc)
23+
24+
## Requirements
25+
26+
Note that some variants of the Cortex-R have both big-endian instructions and
27+
data. This configuration is known as BE-32, while data-only big-endianness is
28+
known as BE-8. To build programs for BE-32 processors, the GNU linker must be
29+
used with the `-mbe32` option. See [ARM Cortex-R Series Programmer's Guide:
30+
Endianness][endianness] for more details about different endian modes.
31+
32+
When using the hardfloat targets, the minimum floating-point features assumed
33+
are those of the `vfpv3-d16`, which includes single- and double-precision, with
34+
16 double-precision registers. This floating-point unit appears in Cortex-R4F
35+
and Cortex-R5F processors. See [VFP in the Cortex-R processors][vfp]
36+
for more details on the possible FPU variants.
37+
38+
If your processor supports a different set of floating-point features than the
39+
default expectations of `vfpv3-d16`, then these should also be enabled or
40+
disabled as needed with `-C target-feature=(+/-)`.
41+
42+
[endianness]: https://developer.arm.com/documentation/den0042/a/Coding-for-Cortex-R-Processors/Endianness
43+
44+
[vfp]: https://developer.arm.com/documentation/den0042/a/Floating-Point/Floating-point-basics-and-the-IEEE-754-standard/VFP-in-the-Cortex-R-processors
45+
46+
## Start-up and Low-Level Code
47+
48+
The [Rust Embedded Devices Working Group Arm Team] maintain the [`cortex-ar`]
49+
and [`cortex-r-rt`] crates, which may be useful for writing bare-metal code
50+
using this target. Those crates include several examples which run in QEMU and
51+
build using these targets.
52+
53+
[`cortex-ar`]: https://docs.rs/cortex-ar
54+
[`cortex-r-rt`]: https://docs.rs/cortex-r-rt
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# `armv7a-none-eabi` and `armv7a-none-eabihf`
2+
3+
**Tier: 2** for `armv7a-none-eabi`
4+
**Tier: 3** for `armv7a-none-eabihf`
5+
6+
Bare-metal target for CPUs in the Armv7-A architecture family, supporting
7+
dual ARM/Thumb mode, with ARM mode as the default.
8+
9+
Note, this is for processors running in AArch32 mode. For the AArch64 mode
10+
added in Armv8-A, see [`aarch64-unknown-none`](aarch64-unknown-none.md) instead.
11+
12+
Processors in this family include the [Arm Cortex-A5, 8, 32, etc][cortex-a].
13+
14+
See [`arm-none-eabi`](arm-none-eabi.md) for information applicable to all
15+
`arm-none-eabi` targets.
16+
17+
[cortex-a]: https://en.wikipedia.org/wiki/ARM_Cortex-A
18+
19+
## Target maintainers
20+
21+
* [Rust Embedded Devices Working Group Arm Team]
22+
23+
[Rust Embedded Devices Working Group Arm Team]: https://github.com/rust-embedded/wg?tab=readme-ov-file#the-arm-team
24+
25+
## Requirements
26+
27+
All Armv7-A processors include an FPU (a VFPv3 or a VFPv4). The difference
28+
between the `-eabi` and `-eabihf` targets is whether the FPU is used for
29+
passing function arguments. You may prefer the `-eabi` soft-float target when
30+
31+
When using the hardfloat targets, the minimum floating-point features assumed
32+
are those of the `vfpv3-d16`, which includes single- and double-precision,
33+
with 16 double-precision registers. This floating-point unit appears in
34+
Cortex-A8 and Cortex-A8 processors. See [VFP in the Cortex-A processors][vfp]
35+
for more details on the possible FPU variants.
36+
37+
If your processor supports a different set of floating-point features than the
38+
default expectations of `vfpv3-d16`, then these should also be enabled or
39+
disabled as needed with `-C target-feature=(+/-)`.
40+
41+
[vfp]: https://developer.arm.com/documentation/den0013/0400/Floating-Point/Floating-point-basics-and-the-IEEE-754-standard/ARM-VFP
42+
43+
## Start-up and Low-Level Code
44+
45+
The [Rust Embedded Devices Working Group Arm Team] maintain the [`cortex-ar`]
46+
and [`cortex-a-rt`] crates, which may be useful for writing bare-metal code
47+
using this target. Those crates include several examples which run in QEMU and
48+
build using these targets.
49+
50+
[`cortex-ar`]: https://docs.rs/cortex-ar
51+
[`cortex-a-rt`]: https://docs.rs/cortex-a-rt

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# `arm(eb)?v7r-none-eabi(hf)?`
1+
# `armv7r-none-eabi` and `armv7r-none-eabihf`
22

33
**Tier: 2**
44

@@ -7,16 +7,17 @@ dual ARM/Thumb mode, with ARM mode as the default.
77

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

10-
The `eb` versions of this target generate code for big-endian processors.
11-
1210
See [`arm-none-eabi`](arm-none-eabi.md) for information applicable to all
1311
`arm-none-eabi` targets.
1412

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

1715
## Target maintainers
1816

19-
[@chrisnc](https://github.com/chrisnc)
17+
* [@chrisnc](https://github.com/chrisnc)
18+
* [Rust Embedded Devices Working Group Arm Team]
19+
20+
[Rust Embedded Devices Working Group Arm Team]: https://github.com/rust-embedded/wg?tab=readme-ov-file#the-arm-team
2021

2122
## Requirements
2223

@@ -41,7 +42,12 @@ disabled as needed with `-C target-feature=(+/-)`.
4142

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

44-
## Cross-compilation toolchains and C code
45+
## Start-up and Low-Level Code
46+
47+
The [Rust Embedded Devices Working Group Arm Team] maintain the [`cortex-ar`]
48+
and [`cortex-r-rt`] crates, which may be useful for writing bare-metal code
49+
using this target. Those crates include several examples which run in QEMU and
50+
build using these targets.
4551

46-
This target supports C code compiled with the `arm-none-eabi` target triple and
47-
`-march=armv7-r` or a suitable `-mcpu` flag.
52+
[`cortex-ar`]: https://docs.rs/cortex-ar
53+
[`cortex-r-rt`]: https://docs.rs/cortex-r-rt

src/doc/rustc/src/platform-support/armv8r-none-eabihf.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ See [`arm-none-eabi`](arm-none-eabi.md) for information applicable to all
1616

1717
## Target maintainers
1818

19-
[@chrisnc](https://github.com/chrisnc)
19+
* [@chrisnc](https://github.com/chrisnc)
20+
* [Rust Embedded Devices Working Group Arm Team]
21+
22+
[Rust Embedded Devices Working Group Arm Team]: https://github.com/rust-embedded/wg?tab=readme-ov-file#the-arm-team
2023

2124
## Requirements
2225

@@ -34,7 +37,14 @@ Technical Reference Manual for more details.
3437

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

37-
## Cross-compilation toolchains and C code
38-
39-
This target supports C code compiled with the `arm-none-eabi` target triple and
40-
`-march=armv8-r` or a suitable `-mcpu` flag.
40+
### Table of supported CPUs for `armv8r-none-eabihf`
41+
42+
| CPU | FPU | Neon | Target CPU | Target Features |
43+
|:----------- | --- |:---- |:---------------- |:------------------ |
44+
| Any | SP | No | None | None |
45+
| Cortex-R52 | SP | No | `cortex-r52` | `-fp64,-d32,-neon` |
46+
| Cortex-R52 | DP | No | `cortex-r52` | `-neon` |
47+
| Cortex-R52 | DP | Yes | `cortex-r52` | None |
48+
| Cortex-R52+ | SP | No | `cortex-r52plus` | `-fp64,-d32,-neon` |
49+
| Cortex-R52+ | DP | No | `cortex-r52plus` | `-neon` |
50+
| Cortex-R52+ | DP | Yes | `cortex-r52plus` | None |

0 commit comments

Comments
 (0)