Skip to content

Commit 3003fe2

Browse files
compiler: Add riscv64gc-unknown-hermit target
Co-authored-by: Martin Kröning <[email protected]> Signed-off-by: Martin Kröning <[email protected]>
1 parent 636804e commit 3003fe2

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

compiler/rustc_target/src/spec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,7 @@ supported_targets! {
14181418
("msp430-none-elf", msp430_none_elf),
14191419

14201420
("aarch64-unknown-hermit", aarch64_unknown_hermit),
1421+
("riscv64gc-unknown-hermit", riscv64gc_unknown_hermit),
14211422
("x86_64-unknown-hermit", x86_64_unknown_hermit),
14221423

14231424
("riscv32i-unknown-none-elf", riscv32i_unknown_none_elf),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
use crate::spec::{CodeModel, RelocModel, Target, TargetOptions, TlsModel};
2+
3+
pub fn target() -> Target {
4+
Target {
5+
llvm_target: "riscv64-unknown-hermit".into(),
6+
pointer_width: 64,
7+
arch: "riscv64".into(),
8+
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
9+
options: TargetOptions {
10+
cpu: "generic-rv64".into(),
11+
features: "+m,+a,+f,+d,+c".into(),
12+
relocation_model: RelocModel::Pic,
13+
code_model: Some(CodeModel::Medium),
14+
tls_model: TlsModel::LocalExec,
15+
max_atomic_width: Some(64),
16+
llvm_abiname: "lp64d".into(),
17+
..super::hermit_base::opts()
18+
},
19+
}
20+
}

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

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ static TARGETS: &[&str] = &[
122122
"riscv32imac-unknown-none-elf",
123123
"riscv32gc-unknown-linux-gnu",
124124
"riscv64imac-unknown-none-elf",
125+
"riscv64gc-unknown-hermit",
125126
"riscv64gc-unknown-none-elf",
126127
"riscv64gc-unknown-linux-gnu",
127128
"s390x-unknown-linux-gnu",

0 commit comments

Comments
 (0)