Skip to content

Commit ea661e9

Browse files
committed
Re-order and re-work the aarch64-unknown-none platform support page.
Removes a bunch of information that isn't, strictly speaking, target specific.
1 parent 4383a4f commit ea661e9

File tree

1 file changed

+17
-60
lines changed

1 file changed

+17
-60
lines changed

src/doc/rustc/src/platform-support/aarch64-unknown-none.md

Lines changed: 17 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -19,44 +19,19 @@ Processors in this family include the [Arm Cortex-A35, 53, 76, etc][aarch64-cpus
1919

2020
## Target CPU and Target Feature options
2121

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):
22+
All AArch64 processors include an FPU. The difference between the `-none` and
23+
`-none-softfloat` targets is whether the FPU is used for passing function arguments.
24+
You may prefer the `-softfloat` target when writing a kernel or interfacing with
25+
pre-compiled binaries that use the soft-float ABI.
4726

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

6136
[target-cpu]: https://doc.rust-lang.org/rustc/codegen-options/index.html#target-cpu
6237
[target-feature]: https://doc.rust-lang.org/rustc/codegen-options/index.html#target-feature
@@ -72,36 +47,23 @@ package manager. To use it, add the following to your `.cargo/config.toml`:
7247

7348
```toml
7449
[target.aarch64-unknown-none]
75-
linker = "aarch64-none-ld"
50+
linker = "aarch64-none-elf-ld"
7651
```
7752

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

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

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=(+/-)`.
96-
9761
[arm-gnu-toolchain]: https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain
9862

99-
## Testing
100-
101-
This is a cross-compiled target that you will need to emulate during testing.
63+
## Cross-compilation toolchains and C code
10264

103-
The exact emulator that you'll need depends on the specific device you want to
104-
run your code on.
65+
This target supports C code compiled with the `aarch64-none-elf` target
66+
triple and a suitable `-march` or `-mcpu` flag.
10567

10668
## Start-up and Low-Level Code
10769

@@ -113,8 +75,3 @@ The *TrustedFirmware* group also maintain [Rust crates for this
11375
target](https://github.com/ArmFirmwareCrates).
11476

11577
[`aarch64-cpu`]: https://docs.rs/aarch64-cpu
116-
117-
## Cross-compilation toolchains and C code
118-
119-
This target supports C code compiled with the `aarch64-unknown-none` target
120-
triple and a suitable `-march` or `-mcpu` flag.

0 commit comments

Comments
 (0)