mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user