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

support std crate in VM programs. #654

Open
vivekvpandya opened this issue Sep 21, 2023 · 4 comments
Open

support std crate in VM programs. #654

vivekvpandya opened this issue Sep 21, 2023 · 4 comments
Assignees

Comments

@vivekvpandya
Copy link
Contributor

For our custom target some operations from std crate is not supported. For example https://github.com/rust-lang/rust/blob/master/library/std/src/sys/unsupported/thread_local_key.rs#L5
Above code is used in panic_handler and itself panics creating infinite loop.

This issue is created to solve issues like above so that VM programs can use std crate.

@matthiasgoergens
Copy link
Collaborator

Perhaps see how Risc-Zero does it.

@vivekvpandya
Copy link
Contributor Author

Perhaps see how Risc-Zero does it.

They maintain their own fork for Rust std lib. See https://github.com/risc0/rust/blob/risc0/library/panic_abort/src/lib.rs#L39
and https://github.com/risc0/risc0/blob/main/risc0/cargo-risczero/src/toolchain.rs#L27 (where this gets included)

@vivekvpandya
Copy link
Contributor Author

https://github.com/0xmozak/rust/tree/mozak This fork of rust may help with this issue.

@phildimes phildimes added this to the Release 0.3 milestone Dec 8, 2023
@vivekvpandya
Copy link
Contributor Author

if in future we ever need to have native run with no_std then we can use my attached patch for starting guest related changes.
no_std_native.patch.txt

@phildimes phildimes removed this from the Release 0.3 milestone Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants