From 02df7d1159388f72a50733f7e16c94fc989ae56b Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Thu, 14 May 2026 09:23:20 -0700 Subject: [PATCH] Workaround for release corerun.wasm not having exported stack pointer --- src/coreclr/hosts/corerun/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/coreclr/hosts/corerun/CMakeLists.txt b/src/coreclr/hosts/corerun/CMakeLists.txt index fff6415cc16f8c..623ba59e8a600a 100644 --- a/src/coreclr/hosts/corerun/CMakeLists.txt +++ b/src/coreclr/hosts/corerun/CMakeLists.txt @@ -91,6 +91,12 @@ else() -sENVIRONMENT=node,shell,web -Wl,--error-limit=0) + # HACK: Workaround for bug in wasm-opt that strips __stack_pointer + # -g forces 'limited post-link optimizations'. I tried a dozen other workarounds and this is the only thing that worked. + # This bug may be fixed in latest emscripten. + target_link_options(corerun PRIVATE + -g) + if (CORERUN_IN_BROWSER) # Node.js doesn't have good support for WASM_BIGINT # so it only is added when running in the browser.