Skip to content
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

wasm2js: support multiple tables #7358

Open
joe-p opened this issue Mar 8, 2025 · 2 comments
Open

wasm2js: support multiple tables #7358

joe-p opened this issue Mar 8, 2025 · 2 comments

Comments

@joe-p
Copy link

joe-p commented Mar 8, 2025

Currently wasm2js does not support multiple tables. This is problematic for anyone that has WASM binaries compiled from Rust 1.82+ because the reference-types LLVM feature was enabled by default which results in multiple tables.

@kripken
Copy link
Member

kripken commented Mar 11, 2025

See discussion and workarounds on the rust side:

Separately, it would be nice to support multiple tables in wasm2js, but those links might help people stuck right now.

@joe-p
Copy link
Author

joe-p commented Mar 11, 2025

Yes thank you! Should have shared that I have read those discussions and some other threads and right now the best solution for me seems to be stripping symbols when building for wasm2js. I did this by adding -C strip=symbols to my RUSTFLAGS when running wasm-pack for wasm2js. Full build script can be seen here. Stripping symbols, however, is a bit opaque to me and I don't have confidence in the stability of this solution going forward, but that's mostly due to my lack of knowledge on how wasm-bindgen and the Rust compiler work.

Alternatively you could rebuild std with reference types disabled, but I do not want to rely on nightly toolchain for a feature that is seemingly not close to standardization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants