Closed wooden-worm closed 1 day ago
I tried to build an example project for wasm64-unknown-unknown with target-feature=+atomics, but the std failed to build due to https://github.com/rust-lang/rust/blob/7a08f84627ff3035de4d66ff3209e5fc93165dcb/library/std/src/sys/pal/wasm/atomics/futex.rs#L1 and https://github.com/rust-lang/rust/blob/7a08f84627ff3035de4d66ff3209e5fc93165dcb/library/std/src/sys/pal/wasm/atomics/thread.rs#L22 hardcoding wasm32 arch.
wasm64-unknown-unknown
target-feature=+atomics
std
wasm32
I could get std to build by adding #![feature(simd_wasm64)] to https://github.com/rust-lang/rust/blob/master/library/std/src/lib.rs, and a few cfg checks to import the correct module.
#![feature(simd_wasm64)]
cfg
I could work on a PR if that's the right approach.
rustc --version --verbose:
rustc --version --verbose
rustc 1.81.0-nightly (d7f6ebace 2024-06-16) binary: rustc commit-hash: d7f6ebacee13b6c03623c4b74197280454ede8de commit-date: 2024-06-16 host: aarch64-apple-darwin release: 1.81.0-nightly LLVM version: 18.1.7
There's another similar problem with building for wasm64 using target-feature=+simd128: portable-simd only supports wasm32
wasm64
target-feature=+simd128
portable-simd
https://github.com/rust-lang/rust/blob/4e6de37349c7838df095b085a2640cb6a007c96a/library/portable-simd/crates/core_simd/src/swizzle_dyn.rs#L31
that sounds about right as a fix. feel free to PR it!
I tried to build an example project for
wasm64-unknown-unknown
withtarget-feature=+atomics
, but thestd
failed to build due to https://github.com/rust-lang/rust/blob/7a08f84627ff3035de4d66ff3209e5fc93165dcb/library/std/src/sys/pal/wasm/atomics/futex.rs#L1 and https://github.com/rust-lang/rust/blob/7a08f84627ff3035de4d66ff3209e5fc93165dcb/library/std/src/sys/pal/wasm/atomics/thread.rs#L22 hardcodingwasm32
arch.I could get
std
to build by adding#![feature(simd_wasm64)]
to https://github.com/rust-lang/rust/blob/master/library/std/src/lib.rs, and a fewcfg
checks to import the correct module.I could work on a PR if that's the right approach.
Meta
rustc --version --verbose
: