std: Implement futex on wasip3 targets, update target spec#159731
Open
alexcrichton wants to merge 1 commit into
Open
std: Implement futex on wasip3 targets, update target spec#159731alexcrichton wants to merge 1 commit into
alexcrichton wants to merge 1 commit into
Conversation
Collaborator
|
These commits modify compiler targets. |
Collaborator
|
r? @clarfonthey rustbot has assigned @clarfonthey. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
alexcrichton
force-pushed
the
wasip3-futex
branch
from
July 22, 2026 18:07
2077e3e to
42444f6
Compare
This comment has been minimized.
This comment has been minimized.
alexcrichton
force-pushed
the
wasip3-futex
branch
from
July 22, 2026 18:17
42444f6 to
21df076
Compare
This comment has been minimized.
This comment has been minimized.
This commit is in preparation for eventual [tier 2 status] for the `wasm32-wasip3` target. Initially this target will not have support for threads but it's expected to come ~later this year. The first step in supporting this is switching internal `#[cfg]` in the standard library to "ok this target has threads", and this commit is the update for synchronization primitives. All synchronization primitives on the `wasm32-wasip3` now use a `futex`-based implementation, and the implementation of the futex itself is located in wasi-libc (see WebAssembly/wasi-libc/834). Other WASI targets can eventually all use this implementation as well, but `wasi-libc`'s implementation of these symbols will need to percolate, so those targets aren't changed yet. For `wasm32-wasip3`, however, any supporting `wasi-libc` will have these symbols. This then additionally fixes the target to actually build with a modern LLVM by passing a necessary flag to `wasm-ld`. This flag isn't supported until LLVM 23, but the `wasm32-wasip3` target isn't fully supported until LLVM 23 anyway (hence its Tier 3 status currently). [tier 2 status]: rust-lang/compiler-team#1001
alexcrichton
force-pushed
the
wasip3-futex
branch
from
July 22, 2026 19:07
21df076 to
5871216
Compare
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.
This commit is in preparation for eventual tier 2 status for the
wasm32-wasip3target. Initially this target will not have support for threads but it's expected to come ~later this year. The first step in supporting this is switching internal#[cfg]in the standard library to "ok this target has threads", and this commit is the update for synchronization primitives. All synchronization primitives on thewasm32-wasip3now use afutex-based implementation, and the implementation of the futex itself is located in wasi-libc (see WebAssembly/wasi-libc#834). Other WASI targets can eventually all use this implementation as well, butwasi-libc's implementation of these symbols will need to percolate, so those targets aren't changed yet. Forwasm32-wasip3, however, any supportingwasi-libcwill have these symbols.This then additionally fixes the target to actually build with a modern LLVM by passing a necessary flag to
wasm-ld. This flag isn't supported until LLVM 23, but thewasm32-wasip3target isn't fully supported until LLVM 23 anyway (hence its Tier 3 status currently).