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

Remove build-std cargo option and switch to core::intrinsics::abort() in panic_handler #135

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

greenhat
Copy link
Contributor

This PR is stacked on top of #134 and should be merged after it

Close #124

components and Miden SDK tests.

The panic handler and global allocator is now set in the `lib.rs` file
of each component crate. Before, the `cargo-component-bindings` was not
built correctly for `no_std` and was linking the stdlib allocator.

The Rust bindings for the WIT are now generated in the `src` directory
of the component crate, instead of the `target/.../bindings` directory.

The Wasm `bulk-memory` proposal is enabled via `RUSTFLAGS` so that
`memcpy` function import is replaced with Wasm `memory.copy` op.
Add Wasm component translation support to `CompileTest`.
Draft a text representation of the IR `Component` and use it in the
expected tests.
Swap function calls to imported functions with the external function
passed as module arguments.
according to the instantiation order
in the final stage of the translation to make the overall algorithm and
steps more clear and concise.
Raise errors when an particular item translation is not(yet) implemented.
since at component boundaries every function is invoked via `call`.
@greenhat greenhat changed the title Remove build-std cargo option and switch to core::intrinsics::abort() in panic_handler [4/x] Remove build-std cargo option and switch to core::intrinsics::abort() in panic_handler Feb 29, 2024
@greenhat
Copy link
Contributor Author

greenhat commented Mar 1, 2024

@bitwalker I switched to using core::intrinsics::abort() in panic handler from build-std cargo option and hit a problem. Vecindexing brings its bounds checking with text formatting(core::fmt, etc.), which is unaffected by core::intrinsics::abort(). Switching to Vec::get() with unwrapping fares slightly better, but still brings some unnecessary text formatting. I have not dive deep into it yet, just thought you might have an idea.

@greenhat greenhat changed the title [4/x] Remove build-std cargo option and switch to core::intrinsics::abort() in panic_handler Remove build-std cargo option and switch to core::intrinsics::abort() in panic_handler Mar 1, 2024
@greenhat greenhat force-pushed the greenhat/remove-invoke-method branch from a77c8c8 to eab6463 Compare March 1, 2024 15:42
@bitwalker bitwalker force-pushed the greenhat/remove-invoke-method branch from eab6463 to 4dfcbfe Compare March 15, 2024 07:15
Base automatically changed from greenhat/remove-invoke-method to main March 15, 2024 07:16
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

Successfully merging this pull request may close these issues.

use core::intrinsics::abort() in panic handler and ditch build-std option (compiles std, alloc, core)
1 participant