-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with shared memory and linking with rust-lld in multithreading #1328
Comments
Are you using a nightly build? According to the folks at
Their advice:
Source: https://github.com/GoogleChromeLabs/wasm-bindgen-rayon#using-config-files |
Very interestingly, compiling the raytracer example with RUSTFLAGS set produces this error, but creating a [unstable]
build-std = ['std', 'panic_abort']
[build]
target = "wasm32-unknown-unknown"
rustflags = '-Ctarget-feature=+atomics,+bulk-memory,+mutable-globals' works about fine. Really strange, I may look into this later and open up issue. In the case that this still doesn't work for whatever reason, you can manually specify the
|
This made the trick for me! |
🐛 Bug description
Hello, I keep getting an error when trying to compile a multithreaded Rust library to WASM using
wasm-pack
.I used the following recommended flags for compilation :
export RUSTFLAGS='-C target-feature=+atomics,+bulk-memory,+mutable-globals'
before
cargo build --target wasm32-unknown-unknown -Z build-std=panic_abort,std
.But then, when trying
wasm-pack build --target web
(as well aswasm-pack build --target no-modules
) I keep getting this error :which is related to the flags that I setup (I need them to be compatible with multithreading btw).
I also tried to replace
std::thread
withwasm_thread
crate but got exactly the same issue when using the flags for multithreading.Any idea on how to solve my issue, please? Any help would be greatly appreciated :pray_tone2:
Steps to reproduce
You can clone my repo and do previous commands in this directory.
🤔 Expected Behavior
wasm-pack
should build my WASM package.🌍 Your environment
Include the relevant details of your environment.
wasm-pack version: 0.12.1
rustc version: rustc 1.74.0-nightly (84a9f4c6e 2023-08-29)
The text was updated successfully, but these errors were encountered: