From bff0b2f48b4d3990e02bc6020748f505bd85b5fe Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Wed, 6 May 2026 15:08:06 -0700 Subject: [PATCH] Require names when using `STACK_OVERFLOW_CHECK=2` See https://github.com/WebAssembly/binaryen/pull/8679 See #24964 --- test/test_other.py | 1 + tools/emscripten.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/test/test_other.py b/test/test_other.py index aaf37a772ff95..38b73c6cc34a5 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -3192,6 +3192,7 @@ def test_dwarf_sourcemap_names(self): (['-Oz', '-gsource-map'], False, True, False), (['-gsource-map', '-sERROR_ON_WASM_CHANGES_AFTER_LINK'], False, True, False), (['-gsource-map', '-Og', '-sERROR_ON_WASM_CHANGES_AFTER_LINK'], False, True, False), + (['-sSTACK_OVERFLOW_CHECK=2'], False, False, False), ]: print(flags, expect_dwarf, expect_sourcemap, expect_names) self.emcc(test_file(source_file), flags + ['-o', js_file]) diff --git a/tools/emscripten.py b/tools/emscripten.py index a2b39ce1e26d4..3c95a1f380971 100644 --- a/tools/emscripten.py +++ b/tools/emscripten.py @@ -541,7 +541,9 @@ def finalize_wasm(infile, outfile, js_syms): args.append('--side-module') if settings.STACK_OVERFLOW_CHECK >= 2: args.append('--check-stack-overflow') + # The check-stack pass in binaryen needs to be able to locate `__stack_pointer` by name. modify_wasm = True + need_name_section = True if settings.STANDALONE_WASM: args.append('--standalone-wasm')