@@ -19,44 +19,19 @@ Processors in this family include the [Arm Cortex-A35, 53, 76, etc][aarch64-cpus
19
19
20
20
## Target CPU and Target Feature options
21
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):
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.
47
26
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.
60
35
61
36
[ target-cpu ] : https://doc.rust-lang.org/rustc/codegen-options/index.html#target-cpu
62
37
[ 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`:
72
47
73
48
``` toml
74
49
[target .aarch64-unknown-none ]
75
- linker = " aarch64-none-ld"
50
+ linker = " aarch64-none-elf- ld"
76
51
```
77
52
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
79
54
linker. This is needed when using GCC's link time optimization.
80
55
81
56
These targets don't provide a linker script, so you'll need to bring your own
82
57
according to the specific device you are using. Pass
83
58
` -Clink-arg=-Tyour_script.ld ` as a rustc argument to make the linker use
84
59
` your_script.ld ` during linking.
85
60
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
-
97
61
[ arm-gnu-toolchain ] : https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain
98
62
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
102
64
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 .
105
67
106
68
## Start-up and Low-Level Code
107
69
@@ -113,8 +75,3 @@ The *TrustedFirmware* group also maintain [Rust crates for this
113
75
target] ( https://github.com/ArmFirmwareCrates ) .
114
76
115
77
[ `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