Rollup merge of #153174 - Trivo25:fix-wasm64-sync-cfg, r=joboet

std: add wasm64 to sync::Once and thread_parking atomics cfg guards

When targeting `wasm64-unknown-unknown` with atomics enabled, `std::sync::Once` and `thread_parking` fall through to the `no_threads`/`unsupported` implementations because the cfg guards only check for `wasm32`. This causes worker threads to panic with `unreachable` at 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](https://github.com/o1-labs/o1js/)) compiled with `-Z build-std=panic_abort,std` and `-C target-feature=+atomics,+bulk-memory,+mutable-globals`

Related: rust-lang/rust#83879 rust-lang/rust#77839

Happy to adjust anything based on feedback
This commit is contained in:
Jonathan Brouwer
2026-03-06 18:49:47 +01:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
all(target_os = "windows", not(target_vendor="win7")),
target_os = "linux",
target_os = "android",
all(target_arch = "wasm32", target_feature = "atomics"),
all(target_family = "wasm", target_feature = "atomics"),
target_os = "freebsd",
target_os = "motor",
target_os = "openbsd",
@@ -3,7 +3,7 @@
all(target_os = "windows", not(target_vendor = "win7")),
target_os = "linux",
target_os = "android",
all(target_arch = "wasm32", target_feature = "atomics"),
all(target_family = "wasm", target_feature = "atomics"),
target_os = "freebsd",
target_os = "openbsd",
target_os = "dragonfly",