Repository navigation
psm: support stack switching on wasm32-wasip3 - #165
Open
eduardomourar wants to merge 2 commits into
Open
eduardomourar wants to merge 2 commits into
eduardomourar wants to merge 2 commits into
Conversation
eduardomourar
force-pushed
the
wasip3-disable-stack-switching
branch
from
November 22, 2026 00:04
75611e8 to
25e511d
Compare
eduardomourar
marked this pull request as ready for review
November 22, 2026 00:19
eduardomourar
force-pushed
the
wasip3-disable-stack-switching
branch
from
November 24, 2026 23:55
25e511d to
28e4145
Compare
Author
|
@nagisa, I would appreciate a review on this one, please. |
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
wasm32-wasip3 links with --cooperative-threading, which replaces the classic __stack_pointer WebAssembly global with a component-model task-context slot. rust-lld rejects any object that references that global directly. wasi-libc reaches the slot instead through a pair of
imported functions, __wasm_get_stack_pointer/__wasm_set_stack_pointer (module "env"), which wit-component recognizes by name and rewires during componentization.
Add a wasm32-wasip3 object that imports and calls those functions in place of every global.get/global.set __stack_pointer wasm32.s has, so rust_psm_on_stack/rust_psm_replace_stack work the same way here as on other wasm32 targets, with canswitch = true.
Extend the wasm-test CI matrix to cover wasm32-wasip1/wasip2/wasip3, each run under its own wasmtime invocation.