From 91b086769d8c02e53625781c0ee3b3ed2cf58481 Mon Sep 17 00:00:00 2001 From: Arshia Ghafoori Date: Wed, 15 Jul 2026 11:27:24 +0000 Subject: [PATCH 1/2] Bump wasm-opt to binaryen version_130 for wide-arithmetic support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0.1.30 enables +wide-arithmetic by default (#75), but the pinned binaryen version_123 predates the proposal and fails to parse the resulting wasm ("unknown misc operation: 22" — i64.mul_wide), breaking post-processing for any project whose dependencies emit those ops (axum's tree does). version_130 parses and processes them fine, and the processed binaries run under wasmer. Co-Authored-By: Claude Fable 5 --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index e8cf50e..3a90b5e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -657,7 +657,7 @@ fn run_or_download( } fn install_wasm_opt(path: &ToolPath, config: &Config) -> Result<()> { - let tag = "version_123"; + let tag = "version_130"; let binaryen_url = |target: &str| { let mut url = "https://github.com/WebAssembly/binaryen/releases/download/".to_string(); url.push_str(tag); From 0f233937a157e15cfcca78c3457ced3ef47c1e3f Mon Sep 17 00:00:00 2001 From: Arshia Ghafoori Date: Wed, 15 Jul 2026 15:41:09 +0000 Subject: [PATCH 2/2] Use --emit-exnref instead of --translate-to-exnref MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both flags exist since binaryen's May 2024 rename (#6592), but --translate-to-exnref is an ordinary pass executed at its position on the command line, while --emit-exnref always runs the translation at the end of the whole pipeline — the robust choice (and the one wasixcc uses), immune to argument reordering. Note this does not obviate the version_130 bump: version_123 fails to parse wide-arithmetic modules regardless of which translation flag is used (verified: --emit-exnref on 123 hits the same "unknown misc operation: 22" parse exception). Co-Authored-By: Claude Fable 5 --- src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 3a90b5e..d28702a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -483,7 +483,11 @@ fn run_wasm_opt( cmd.arg("--enable-threads"); cmd.arg("--enable-reference-types"); cmd.arg("--no-validation"); - cmd.arg("--translate-to-exnref"); + // `--emit-exnref` runs the legacy-EH-to-exnref translation at the end of + // the whole pass pipeline regardless of argument order (unlike + // `--translate-to-exnref`, which is an ordinary pass executed at its + // position on the command line). + cmd.arg("--emit-exnref"); if !build.enable_producers_section(profile) { cmd.arg("--strip-producers");