-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fail to compile with WebAssembly atomics and shared memory #102157
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
@rustbot label +O-wasm |
This was referenced Sep 23, 2022
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Oct 11, 2022
Allow compiling the `wasm32-wasi` std library with atomics The issue rust-lang#102157 demonstrates how currently the `-Z build-std` option will fail when re-compiling the standard library with `RUSTFLAGS` like `RUSTFLAGS="-C target-feature=+atomics,+bulk-memory -C link-args=--shared-memory"`. This change attempts to resolve those build issues by depending on the the WebAssembly `futex` module and providing an implementation for `env_lock`. Fixes rust-lang#102157.
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Oct 13, 2022
Allow compiling the `wasm32-wasi` std library with atomics The issue rust-lang#102157 demonstrates how currently the `-Z build-std` option will fail when re-compiling the standard library with `RUSTFLAGS` like `RUSTFLAGS="-C target-feature=+atomics,+bulk-memory -C link-args=--shared-memory"`. This change attempts to resolve those build issues by depending on the the WebAssembly `futex` module and providing an implementation for `env_lock`. Fixes rust-lang#102157.
lyming2007
pushed a commit
to lyming2007/rust
that referenced
this issue
Oct 21, 2022
The issue rust-lang#102157 demonstrates how currently the `-Z build-std` option will fail when re-compiling the standard library with `RUSTFLAGS` like `RUSTFLAGS="-C target-feature=+atomics,+bulk-memory -C link-args=--shared-memory"`. This change attempts to resolve those build issues by depending on the the WebAssembly `futex` module and providing an implementation for `env_lock`. Fixes rust-lang#102157.
Aaron1011
pushed a commit
to Aaron1011/rust
that referenced
this issue
Jan 6, 2023
Allow compiling the `wasm32-wasi` std library with atomics The issue rust-lang#102157 demonstrates how currently the `-Z build-std` option will fail when re-compiling the standard library with `RUSTFLAGS` like `RUSTFLAGS="-C target-feature=+atomics,+bulk-memory -C link-args=--shared-memory"`. This change attempts to resolve those build issues by depending on the the WebAssembly `futex` module and providing an implementation for `env_lock`. Fixes rust-lang#102157.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
It is currently impossible to generate a Wasm module that imports/exports a shared memory using a Rust program. Here is the example program I'm using (though this is not a terribly important detail):
Using
rustc
we quickly realize that we need the standard library to be re-compiled:rustc
failureTo re-compile the standard library, I stick the kernel into a Cargo project but unfortunately the re-compile fails:
cargo
failureI would have expected that to succeed (as documented in #77839). I think I've identified the places that would need to be fixed in the standard library but I wanted to document this issue here first; perhaps there is something I missed? Here are the versions I used above:
The text was updated successfully, but these errors were encountered: