Skip to content

Commit 49c0df4

Browse files
committed
Add the armv8r-none-eabihf target to support the Cortex-R52.
1 parent 8771282 commit 49c0df4

File tree

5 files changed

+39
-0
lines changed

5 files changed

+39
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Targets the Little-endian Cortex-R52 processor (ARMv8-R)
2+
3+
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};
4+
5+
pub fn target() -> Target {
6+
Target {
7+
llvm_target: "armv8r-none-eabihf".into(),
8+
pointer_width: 32,
9+
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
10+
arch: "arm".into(),
11+
12+
options: TargetOptions {
13+
abi: "eabihf".into(),
14+
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
15+
linker: Some("rust-lld".into()),
16+
relocation_model: RelocModel::Static,
17+
panic_strategy: PanicStrategy::Abort,
18+
// The Cortex-R52 has two variants with respect to floating-point support:
19+
// 1. fp-armv8, SP-only, with 16 DP (32 SP) registers
20+
// 2. neon-fp-armv8, SP+DP, with 32 DP registers
21+
// Use the lesser of these two options as the default, as it will produce code
22+
// compatible with either variant.
23+
//
24+
// Reference:
25+
// Arm Cortex-R52 Processor Technical Reference Manual
26+
// - Chapter 15 Advanced SIMD and floating-point support
27+
features: "+fp-armv8,-fp64,-d32".into(),
28+
max_atomic_width: Some(64),
29+
emit_debug_gdb_scripts: false,
30+
// GCC defaults to 8 for arm-none here.
31+
c_enum_min_bits: Some(8),
32+
..Default::default()
33+
},
34+
}
35+
}

compiler/rustc_target/src/spec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1373,6 +1373,7 @@ supported_targets! {
13731373
("armebv7r-none-eabihf", armebv7r_none_eabihf),
13741374
("armv7r-none-eabi", armv7r_none_eabi),
13751375
("armv7r-none-eabihf", armv7r_none_eabihf),
1376+
("armv8r-none-eabihf", armv8r_none_eabihf),
13761377

13771378
("x86_64-pc-solaris", x86_64_pc_solaris),
13781379
("x86_64-sun-solaris", x86_64_sun_solaris),

src/ci/docker/host-x86_64/dist-various-1/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ ENV TARGETS=$TARGETS,armebv7r-none-eabi
138138
ENV TARGETS=$TARGETS,armebv7r-none-eabihf
139139
ENV TARGETS=$TARGETS,armv7r-none-eabi
140140
ENV TARGETS=$TARGETS,armv7r-none-eabihf
141+
ENV TARGETS=$TARGETS,armv8r-none-eabihf
141142
ENV TARGETS=$TARGETS,thumbv7neon-unknown-linux-gnueabihf
142143
ENV TARGETS=$TARGETS,armv7a-none-eabi
143144

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

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ target | std | notes
147147
`armv7a-none-eabi` | * | Bare ARMv7-A
148148
`armv7r-none-eabi` | * | Bare ARMv7-R
149149
`armv7r-none-eabihf` | * | Bare ARMv7-R, hardfloat
150+
`armv8r-none-eabihf` | * | Bare ARMv8-R, hardfloat
150151
`asmjs-unknown-emscripten` | ✓ | asm.js via Emscripten
151152
`i586-pc-windows-msvc` | * | 32-bit Windows w/o SSE
152153
`i586-unknown-linux-gnu` | ✓ | 32-bit Linux w/o SSE (kernel 3.2, glibc 2.17)

src/tools/build-manifest/src/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ static TARGETS: &[&str] = &[
8282
"armebv7r-none-eabihf",
8383
"armv7r-none-eabi",
8484
"armv7r-none-eabihf",
85+
"armv8r-none-eabihf",
8586
"armv7s-apple-ios",
8687
"asmjs-unknown-emscripten",
8788
"bpfeb-unknown-none",

0 commit comments

Comments
 (0)