Skip to content

Commit

Permalink
compiler: Add riscv64gc-unknown-hermit target
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
  • Loading branch information
simonschoening and mkroening committed Jul 24, 2023
1 parent 636804e commit 3003fe2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,7 @@ supported_targets! {
("msp430-none-elf", msp430_none_elf),

("aarch64-unknown-hermit", aarch64_unknown_hermit),
("riscv64gc-unknown-hermit", riscv64gc_unknown_hermit),
("x86_64-unknown-hermit", x86_64_unknown_hermit),

("riscv32i-unknown-none-elf", riscv32i_unknown_none_elf),
Expand Down
20 changes: 20 additions & 0 deletions compiler/rustc_target/src/spec/riscv64gc_unknown_hermit.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use crate::spec::{CodeModel, RelocModel, Target, TargetOptions, TlsModel};

pub fn target() -> Target {
Target {
llvm_target: "riscv64-unknown-hermit".into(),
pointer_width: 64,
arch: "riscv64".into(),
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
options: TargetOptions {
cpu: "generic-rv64".into(),
features: "+m,+a,+f,+d,+c".into(),
relocation_model: RelocModel::Pic,
code_model: Some(CodeModel::Medium),
tls_model: TlsModel::LocalExec,
max_atomic_width: Some(64),
llvm_abiname: "lp64d".into(),
..super::hermit_base::opts()
},
}
}
1 change: 1 addition & 0 deletions src/tools/build-manifest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ static TARGETS: &[&str] = &[
"riscv32imac-unknown-none-elf",
"riscv32gc-unknown-linux-gnu",
"riscv64imac-unknown-none-elf",
"riscv64gc-unknown-hermit",
"riscv64gc-unknown-none-elf",
"riscv64gc-unknown-linux-gnu",
"s390x-unknown-linux-gnu",
Expand Down

0 comments on commit 3003fe2

Please sign in to comment.