-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rust 1.82.0 wasm32-unknown-unknown triggers issues with wasm-bindgen >= 0.2.94 #132620
Comments
If I use I can't tell for sure, but this comment may be confirming this. |
cc @alexcrichton , though I kinda expect this to be one of the wasm proposals that has become enabled-by-default by llvm |
LLVM has enabled it on October 25th llvm/llvm-project#112049 but that's after the compiler's commit date, so that can't have been it. Without having seen the wasm / wat file (would be great if you put that in the repository as well), I'd say it's very likely to just be the expected fallout from https://blog.rust-lang.org/2024/09/24/webassembly-targets-change-in-default-target-features.html#enabling-reference-types-by-default caused by an outdated wasm-opt. |
Yeah, bulk-memory is supposed to be enabled in LLVM 20 only, not in LLVM 19. |
@eric-seppanen the error message in the linked issue is:
where here "misc prefix" is 0xfc and 17 as the opcode means that this is a If you think you're not running into this I think it would be best to get a reproduction which involves running cargo/rustc directly and then inspecting the output binary to ensure there aren't any other tools in play here. |
@alexcrichton thanks for the help. My build process certainly invokes wasm-bindgen (both with and without Trunk). I tried downgrading the If I update If I understand correctly, this means there's something about the code emitted by rust 1.82.0 that triggers the problem in wasm-bindgen 0.2.95. If that's the case, then I can try to move the discussion over there. |
Yes Rust 1.82 would emit AFAIK this behavior is being disabled in wasm-bindgen, but you can also confirm with maintainers that this is the case. |
bulk-memory
target-feature
Since this will be resolved in the next release (0.2.96?) of wasm-bindgen, I think this can be closed. |
I found that a wasm project that builds under Trunk with Rust 1.81.0, no longer builds with Rust 1.82.0. This seems to be because
rustc now emitswasm "bulk memory" instructions that Trunk's bundledwasm-opt
can't deal with. I haven't found any documented reason why this changed between 1.81.0 and 1.82.0, so I fear it may have been accidentally introduced by the switch to LLVM 19, which was documented to enable two other target-features (but not "bulk memory").Code
I minimized an affected project, which can be found here: https://github.com/eric-seppanen/wasm_test_2024
It's not very well minimized, because the problem appears when using the
gloo
crate, which has a large dependency tree.I expected to see this happen: project builds under rust 1.82.0, just like it does under 1.81.0, and the emitted code is compatible with Trunk and wasm-opt v116 that is bundled with Trunk.
Instead, this happened: trunk fails to build because:
wasm-opt
binary does not understand "bulk memory" instructions.The rustc book contains a list of wasm target features that are enabled by default. The bulk-memory feature is not listed among them.
Version it worked on
It most recently worked on: 1.81.0
Version with regression
rustc --version --verbose
:I also filed an issue with Trunk.
The text was updated successfully, but these errors were encountered: