-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
riscv32im-unknown-openvm-elf: add target #149797
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
base: main
Are you sure you want to change the base?
riscv32im-unknown-openvm-elf: add target #149797
Conversation
|
The Miri subtree was changed cc @rust-lang/miri Some changes occurred in src/doc/rustc/src/platform-support cc @Noratrieb These commits modify compiler targets. |
|
r? @ChrisDenton rustbot has assigned @ChrisDenton. Use |
|
|
r? compiler |
This comment has been minimized.
This comment has been minimized.
|
New targets need an MCP to be filed at https://github.com/rust-lang/compiler-team/issues. I don't think that has happened yet for this one? The MCP should explain what exactly is meant by "limited" std support. Which operations work, which don't? We want to avoid repeating the mistake that is wasm32-unk-unk where hardly anything in std works -- that target should have been no_std. |
This comment has been minimized.
This comment has been minimized.
|
MCP is optional for tier 3 targets:
IIRC, it has changed this year. |
|
Ah, I see. The comment about "limited" std support stands though -- please summarize what exactly that means in terms of which operations are available and which are missing. In particular, are there any operations that just panic because they cannot return a |
Yes, the intention is that if it's non-controversial, a PR suffices, but the reviewer can elect to request a MCP esp. if the proposed target has quirks ™️ (such as limited std support, or discuss things about a target that possibly can never progress past Tier 3 for whatever reason). |
|
I believe libs have previously said that they would want new tier 2 std targets to at least support cc @rust-lang/libs-api @rust-lang/libs |
|
Regarding OpenVM supports standard Rust written using the
For the current implementations of the PAL abi extern functions, see https://github.com/openvm-org/openvm/blob/main/crates/toolchain/openvm/src/pal_abi.rs For the unimplemented functionality mentioned, we do not However as mentioned in the PR description, it is very important that this target is not |
Thanks for listing that!
Yes, I have seen that. However, for the health of the overall Rust ecosysten, it is also important to avoid repeating the wasm32-u-u mistake. If what @ChrisDenton wrote is correct, then indeed for tier 3 it doesn't really matter. :) |
|
Actually I'm a bit baffled about the need for std. The linked book strongly suggests using |
1 similar comment
|
Actually I'm a bit baffled about the need for std. The linked book strongly suggests using |
Not exhaustive as it doesn't cover the cases where we just used the default unsupported modules: #[path = "../unsupported/os.rs"]
pub mod os;
#[path = "../unsupported/pipe.rs"]
pub mod pipe;
#[path = "../unsupported/time.rs"]
pub mod time;Based on the implementation there, I believe calling any
We recommend |
|
That sounds like exactly the argument that was given for wasm. The result is a mess; many crates are std because they actually need std APIs so they fail in random unexpected ways due to things panicking, and often you have to add explicit Actually patching dependencies for no_std support is the proper thing to do here -- actually fixing the problem once rather than having everyone deal with a never-ending stream of odd panics and other unexpected failures. It's more work upfront, but the result is a much healthier ecosystem. (Long-term we probably want a more modular approach to std overall, but I assume that will only happen if people from the affected domains work together on pushing such a project forward.) Anyway, it's not my call to make; the libs teams have been pinged and we'll see what they say. |
|
^Understood. Will just add that if there is a question about whether |
This pull request adds OpenVM as a new target for Rust. The
riscv32im-unknown-openvm-elftarget runs inside a virtual machine with full support for the RV32IM ISA. The target includes limited support forstdthrough customizable non-standard RISC-V instruction set extensions which are configurable in the OpenVM framework. Whilestdlibrary support is currently limited (see book for details), it is important to have this functionality for downstream users to compile existing crates that are notno_stdbut in practice require limited OS functionality. Moreover, additional support for morestdfeatures is expected and can be customizable through extensions of the VM.We have chosen the
-unknown-openvm-elfnaming policy in accordance with the discussion in #135376 (comment)Further details may be found in the target description doc.
Tier 3 target policy:
Here is a copy of the tier 3 target policy:
The maintainers are named in the target description file
We understand. While the target shares similarities to
riscv32im-risc0-zkvm-elf, we choose theriscv32im-unknown-openvm-elfnaming in accordance with the discussion in #135376 (comment)We understand and will not introduce incompatibilities.
We understand. The code added to the Rust repository is under
MIT OR Apache-2.0license.We understand. The runtime libraries and the execution environment and software associated with this environment uses
MIT OR Apache-2.0so this should not be an issue.We understand. All OpenVM crates that may be required for correct linking are also licensed under
MIT OR Apache-2.0license.There are no such terms present
We understand.
We understand.
The target implements core and alloc. Support for
stdis limited, with some functionality stubbed out. The target providesstdsupport through custom RISC-V instruction set extensions (see book for details) and is not meant to provide a full OS. Howeverstdsupport is still important for downstream users of the target due to the need to compile existing crates that are notno_stdbut in practice require limited OS functionality. Furthermore, due to the customizable framework of the target virtual machines, more comprehensivestdsupport may be implemented with extensions in the future.See file target description file
We understand.
We understand.
We understand.
ELF binaries for the target can be generated using the LLVM backend.
We understand.