Skip to content

Commit 86d2722

Browse files
committed
Add riscv imafc bare metal targets
- riscv32imac-unknown-none-elf - riscv64imac-unknown-none-elf
1 parent c225c45 commit 86d2722

File tree

6 files changed

+57
-0
lines changed

6 files changed

+57
-0
lines changed

Diff for: compiler/rustc_target/src/spec/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1641,10 +1641,12 @@ supported_targets! {
16411641
("riscv32imc-esp-espidf", riscv32imc_esp_espidf),
16421642
("riscv32imac-esp-espidf", riscv32imac_esp_espidf),
16431643
("riscv32imac-unknown-none-elf", riscv32imac_unknown_none_elf),
1644+
("riscv32imafc-unknown-none-elf", riscv32imafc_unknown_none_elf),
16441645
("riscv32imac-unknown-xous-elf", riscv32imac_unknown_xous_elf),
16451646
("riscv32gc-unknown-linux-gnu", riscv32gc_unknown_linux_gnu),
16461647
("riscv32gc-unknown-linux-musl", riscv32gc_unknown_linux_musl),
16471648
("riscv64imac-unknown-none-elf", riscv64imac_unknown_none_elf),
1649+
("riscv64imafc-unknown-none-elf", riscv64imafc_unknown_none_elf),
16481650
("riscv64gc-unknown-none-elf", riscv64gc_unknown_none_elf),
16491651
("riscv64gc-unknown-linux-gnu", riscv64gc_unknown_linux_gnu),
16501652
("riscv64gc-unknown-linux-musl", riscv64gc_unknown_linux_musl),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};
2+
3+
pub fn target() -> Target {
4+
Target {
5+
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
6+
llvm_target: "riscv32".into(),
7+
pointer_width: 32,
8+
arch: "riscv32".into(),
9+
10+
options: TargetOptions {
11+
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
12+
linker: Some("rust-lld".into()),
13+
cpu: "generic-rv32".into(),
14+
max_atomic_width: Some(32),
15+
features: "+m,+a,+c,+f".into(),
16+
panic_strategy: PanicStrategy::Abort,
17+
relocation_model: RelocModel::Static,
18+
emit_debug_gdb_scripts: false,
19+
eh_frame_header: false,
20+
..Default::default()
21+
},
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
use crate::spec::{Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy};
2+
use crate::spec::{RelocModel, SanitizerSet, Target, TargetOptions};
3+
4+
pub fn target() -> Target {
5+
Target {
6+
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
7+
llvm_target: "riscv64".into(),
8+
pointer_width: 64,
9+
arch: "riscv64".into(),
10+
11+
options: TargetOptions {
12+
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
13+
linker: Some("rust-lld".into()),
14+
cpu: "generic-rv64".into(),
15+
max_atomic_width: Some(64),
16+
features: "+m,+a,+c,+f".into(),
17+
panic_strategy: PanicStrategy::Abort,
18+
relocation_model: RelocModel::Static,
19+
code_model: Some(CodeModel::Medium),
20+
emit_debug_gdb_scripts: false,
21+
eh_frame_header: false,
22+
supported_sanitizers: SanitizerSet::KERNELADDRESS,
23+
..Default::default()
24+
},
25+
}
26+
}

Diff for: src/ci/docker/host-x86_64/dist-various-1/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ ENV TARGETS=$TARGETS,thumbv8m.main-none-eabihf
9696
ENV TARGETS=$TARGETS,riscv32i-unknown-none-elf
9797
ENV TARGETS=$TARGETS,riscv32imc-unknown-none-elf
9898
ENV TARGETS=$TARGETS,riscv32imac-unknown-none-elf
99+
ENV TARGETS=$TARGETS,riscv32imafc-unknown-none-elf
99100
ENV TARGETS=$TARGETS,riscv64imac-unknown-none-elf
101+
ENV TARGETS=$TARGETS,riscv64imafc-unknown-none-elf
100102
ENV TARGETS=$TARGETS,riscv64gc-unknown-none-elf
101103
ENV TARGETS=$TARGETS,armebv7r-none-eabi
102104
ENV TARGETS=$TARGETS,armebv7r-none-eabihf

Diff for: src/doc/rustc/src/platform-support.md

+2
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,11 @@ target | std | notes
162162
[`nvptx64-nvidia-cuda`](platform-support/nvptx64-nvidia-cuda.md) | * | --emit=asm generates PTX code that [runs on NVIDIA GPUs]
163163
`riscv32i-unknown-none-elf` | * | Bare RISC-V (RV32I ISA)
164164
`riscv32imac-unknown-none-elf` | * | Bare RISC-V (RV32IMAC ISA)
165+
`riscv32imafc-unknown-none-elf` | * | Bare RISC-V (RV32IMAFC ISA)
165166
`riscv32imc-unknown-none-elf` | * | Bare RISC-V (RV32IMC ISA)
166167
`riscv64gc-unknown-none-elf` | * | Bare RISC-V (RV64IMAFDC ISA)
167168
`riscv64imac-unknown-none-elf` | * | Bare RISC-V (RV64IMAC ISA)
169+
`riscv64imafc-unknown-none-elf` | * | Bare RISC-V (RV64IMAFC ISA)
168170
`sparc64-unknown-linux-gnu` | ✓ | SPARC Linux (kernel 4.4, glibc 2.23)
169171
`sparcv9-sun-solaris` | ✓ | SPARC Solaris 10/11, illumos
170172
`thumbv6m-none-eabi` | * | Bare ARMv6-M

Diff for: src/tools/build-manifest/src/main.rs

+2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,10 @@ static TARGETS: &[&str] = &[
123123
"riscv32im-unknown-none-elf",
124124
"riscv32imc-unknown-none-elf",
125125
"riscv32imac-unknown-none-elf",
126+
"riscv32imafc-unknown-none-elf",
126127
"riscv32gc-unknown-linux-gnu",
127128
"riscv64imac-unknown-none-elf",
129+
"riscv64imafc-unknown-none-elf",
128130
"riscv64gc-unknown-hermit",
129131
"riscv64gc-unknown-none-elf",
130132
"riscv64gc-unknown-linux-gnu",

0 commit comments

Comments
 (0)