Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mips-zkm-zkvm-elf triple #134721

Closed
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1679,6 +1679,7 @@ supported_targets! {

("mips-unknown-linux-uclibc", mips_unknown_linux_uclibc),
("mipsel-unknown-linux-uclibc", mipsel_unknown_linux_uclibc),
("mips-zkm-zkvm-elf", mips_zkm_zkvm_elf),

("i686-linux-android", i686_linux_android),
("x86_64-linux-android", x86_64_linux_android),
Expand Down
37 changes: 37 additions & 0 deletions compiler/rustc_target/src/spec/targets/mips_zkm_zkvm_elf.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
use crate::abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};

pub(crate) fn target() -> Target {
Target {
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
llvm_target: "mips".into(),
metadata: crate::spec::TargetMetadata {
description: Some("ZKM's zero-knowledge Virtual Machine (MIPS32r2 ISA)".into()),
tier: Some(3),
host_tools: Some(false),
std: None, // ?
},
pointer_width: 32,
arch: "mips".into(),

options: TargetOptions {
os: "zkvm".into(),
vendor: "zkm".into(),
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
linker: Some("rust-lld".into()),
endian: Endian::Big,
cpu: "mips32r2".into(),

max_atomic_width: Some(32),

features: "+mips32r2,+soft-float,+noabicalls".into(),
executables: true,
panic_strategy: PanicStrategy::Abort,
relocation_model: RelocModel::Static,
emit_debug_gdb_scripts: false,
eh_frame_header: false,
singlethread: true,
..Default::default()
},
}
}
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 @@ -128,6 +128,7 @@ static TARGETS: &[&str] = &[
"mipsisa64r6el-unknown-linux-gnuabi64",
"mipsel-unknown-linux-gnu",
"mipsel-unknown-linux-musl",
"mips-zkm-zkvm-elf",
"nvptx64-nvidia-cuda",
"powerpc-unknown-linux-gnu",
"powerpc64-unknown-linux-gnu",
Expand Down
3 changes: 3 additions & 0 deletions tests/assembly/targets/targets-elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@
//@ revisions: mips_unknown_linux_uclibc
//@ [mips_unknown_linux_uclibc] compile-flags: --target mips-unknown-linux-uclibc
//@ [mips_unknown_linux_uclibc] needs-llvm-components: mips
//@ revisions: mips_zkm_zkvm_elf
//@ [mips_unknown_linux_uclibc] compile-flags: --target mips-zkm-zkvm-elf
//@ [mips_unknown_linux_uclibc] needs-llvm-components: mips
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You copied the revision name, this is incorrect.

//@ revisions: mipsel_sony_psp
//@ [mipsel_sony_psp] compile-flags: --target mipsel-sony-psp
//@ [mipsel_sony_psp] needs-llvm-components: mips
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/check-cfg/well-known-values.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
LL | target_vendor = "_UNEXPECTED_VALUE",
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expected values for `target_vendor` are: `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `nintendo`, `nvidia`, `pc`, `risc0`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, and `wrs`
= note: expected values for `target_vendor` are: `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `nintendo`, `nvidia`, `pc`, `risc0`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, `wrs` and `zkm`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration

warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
Expand Down