-
Notifications
You must be signed in to change notification settings - Fork 13.6k
feat: add succinct-zkvm
os and target
#138463
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
Open
nhtyy
wants to merge
7
commits into
rust-lang:master
Choose a base branch
from
succinctlabs:n/succinct-target-only
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ea4c160
feat: succinct-zkvm target
nhtyy 9007968
fix(ci): trailing comma fmt
nhtyy 7e69cf7
fix: include platform-summary
nhtyy 92244b3
fix: pr suggestions, risc32im-succinct-zkvm-elf -> riscv32im-succinct…
nhtyy c0f6dfc
fix: tidy ci
nhtyy 24e8fee
fix: ui tests
nhtyy 53916e1
fix: add platform support top level docs
nhtyy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
feat: succinct-zkvm target
- Loading branch information
commit ea4c1604cf9c3731ae897b013595505ec1dca06b
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
compiler/rustc_target/src/spec/targets/riscv32im_succinct_zkvm_elf.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
use crate::spec::{ | ||
Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, | ||
}; | ||
|
||
pub(crate) fn target() -> Target { | ||
Target { | ||
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(), | ||
llvm_target: "riscv32".into(), | ||
metadata: TargetMetadata { | ||
description: Some("Succinct's zero-knowledge Virtual Machine (RV32IM ISA)".into()), | ||
tier: Some(3), | ||
host_tools: Some(false), | ||
std: None, | ||
}, | ||
pointer_width: 32, | ||
arch: "riscv32".into(), | ||
|
||
options: TargetOptions { | ||
os: "succinct-zkvm".into(), | ||
vendor: "succinct".into(), | ||
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), | ||
linker: Some("rust-lld".into()), | ||
cpu: "generic-rv32".into(), | ||
|
||
// The zkvm is singlethreaded and all operations are atomic. | ||
// The std-lib is compiled with lowered atomicsa and the default Succinct build tools | ||
// enforce this on programs. | ||
max_atomic_width: Some(64), | ||
atomic_cas: true, | ||
|
||
features: "+m".into(), | ||
llvm_abiname: "ilp32".into(), | ||
executables: true, | ||
panic_strategy: PanicStrategy::Abort, | ||
relocation_model: RelocModel::Static, | ||
emit_debug_gdb_scripts: false, | ||
eh_frame_header: false, | ||
singlethread: true, | ||
..Default::default() | ||
}, | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By putting a dash in the target OS, you make it look like it's vendor:succinct, os:zkvm. I would recommend calling it
riscv32im-succinct_zkvm-elf
or even justrustc32im-succinct-elf
insteadThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!