Skip to content

Commit 06a4946

Browse files
committed
Add mips-zkm-zkvm-elf triple
1 parent e4b9d01 commit 06a4946

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

compiler/rustc_target/src/spec/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,8 @@ supported_targets! {
18061806

18071807
("mips-unknown-linux-uclibc", mips_unknown_linux_uclibc),
18081808
("mipsel-unknown-linux-uclibc", mipsel_unknown_linux_uclibc),
1809+
("mips-zkm-zkvm-elf", mips_zkm_zkvm_elf),
1810+
("mipsel-zkm-zkvm-elf", mipsel_zkm_zkvm_elf),
18091811

18101812
("i686-linux-android", i686_linux_android),
18111813
("x86_64-linux-android", x86_64_linux_android),
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
use rustc_abi::Endian;
2+
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};
3+
4+
pub(crate) fn target() -> Target {
5+
Target {
6+
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
7+
llvm_target: "mips-zkm-zkvm-elf".into(),
8+
metadata: crate::spec::TargetMetadata {
9+
description: Some("ZKM's zero-knowledge Virtual Machine (MIPS2 ISA BE)".into()),
10+
tier: Some(3),
11+
host_tools: Some(false),
12+
std: Some(false),
13+
},
14+
pointer_width: 32,
15+
arch: "mips".into(),
16+
17+
options: TargetOptions {
18+
os: "zkvm".into(),
19+
vendor: "zkm".into(),
20+
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
21+
linker: Some("rust-lld".into()),
22+
endian: Endian::Big,
23+
cpu: "mips32r2".into(),
24+
25+
max_atomic_width: Some(32),
26+
atomic_cas: true,
27+
28+
features: "+mips32r2,+soft-float,+noabicalls".into(),
29+
executables: true,
30+
panic_strategy: PanicStrategy::Abort,
31+
relocation_model: RelocModel::Static,
32+
emit_debug_gdb_scripts: false,
33+
eh_frame_header: false,
34+
singlethread: true,
35+
..Default::default()
36+
},
37+
}
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
use rustc_abi::Endian;
2+
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};
3+
4+
pub(crate) fn target() -> Target {
5+
Target {
6+
data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
7+
llvm_target: "mipsel-zkm-zkvm-elf".into(),
8+
metadata: crate::spec::TargetMetadata {
9+
description: Some("ZKM's zero-knowledge Virtual Machine (MIPS2 ISA LE)".into()),
10+
tier: Some(3),
11+
host_tools: Some(false),
12+
std: Some(false),
13+
},
14+
pointer_width: 32,
15+
arch: "mips".into(),
16+
17+
options: TargetOptions {
18+
os: "zkvm".into(),
19+
vendor: "zkm".into(),
20+
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
21+
linker: Some("rust-lld".into()),
22+
endian: Endian::Little,
23+
cpu: "mips32r2".into(),
24+
25+
max_atomic_width: Some(32),
26+
atomic_cas: true,
27+
28+
features: "+mips32r2,+soft-float,+noabicalls".into(),
29+
executables: true,
30+
panic_strategy: PanicStrategy::Abort,
31+
relocation_model: RelocModel::Static,
32+
emit_debug_gdb_scripts: false,
33+
eh_frame_header: false,
34+
singlethread: true,
35+
..Default::default()
36+
},
37+
}
38+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ static TARGETS: &[&str] = &[
135135
"mipsel-unknown-linux-musl",
136136
"mips-mti-none-elf",
137137
"mipsel-mti-none-elf",
138+
"mips-zkm-zkvm-elf",
139+
"mipsel-zkm-zkvm-elf",
138140
"nvptx64-nvidia-cuda",
139141
"powerpc-unknown-linux-gnu",
140142
"powerpc64-unknown-linux-gnu",

0 commit comments

Comments
 (0)