std: add wasm64 to sync::Once and thread_parking atomics cfg guards#153174
Open
Trivo25 wants to merge 1 commit intorust-lang:mainfrom
Open
std: add wasm64 to sync::Once and thread_parking atomics cfg guards#153174Trivo25 wants to merge 1 commit intorust-lang:mainfrom
Trivo25 wants to merge 1 commit intorust-lang:mainfrom
Conversation
Collaborator
|
r? @joboet rustbot has assigned @joboet. Use Why was this reviewer chosen?The reviewer was selected based on:
|
taiki-e
reviewed
Feb 27, 2026
| target_os = "linux", | ||
| target_os = "android", | ||
| all(target_arch = "wasm32", target_feature = "atomics"), | ||
| all(any(target_arch = "wasm32", target_arch = "wasm64"), target_feature = "atomics"), |
Member
There was a problem hiding this comment.
This can be simplified by using target_family = "wasm" which means any(target_arch = "wasm32", target_arch = "wasm64").
Suggested change
| all(any(target_arch = "wasm32", target_arch = "wasm64"), target_feature = "atomics"), | |
| all(target_family = "wasm", target_feature = "atomics"), |
| target_os = "linux", | ||
| target_os = "android", | ||
| all(target_arch = "wasm32", target_feature = "atomics"), | ||
| all(any(target_arch = "wasm32", target_arch = "wasm64"), target_feature = "atomics"), |
Member
There was a problem hiding this comment.
Suggested change
| all(any(target_arch = "wasm32", target_arch = "wasm64"), target_feature = "atomics"), | |
| all(target_family = "wasm", target_feature = "atomics"), |
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.
When targeting
wasm64-unknown-unknownwith atomics enabled,std::sync::Onceandthread_parkingfall through to theno_threads/unsupportedimplementations because the cfg guards only check forwasm32. This causes worker threads to panic withunreachableat runtime. The underlying futex implementations already handle both wasm32 and wasm64 correctly, only the cfg guards were missing wasm64.I tested this manually with a multithreaded wasm64 application (o1js) compiled with
-Z build-std=panic_abort,stdand-C target-feature=+atomics,+bulk-memory,+mutable-globalsRelated: #83879 #77839
Happy to adjust anything based on feedback