From 69d5d3feecc66540db524c333104bbc71a5ae4ad Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Tue, 5 Dec 2023 21:00:37 -0800 Subject: [PATCH] Suppress export name minification (#95613) By default in specific circumstances emscripten will minify export names, which breaks things like getRawCwrap. We can suppress this with `-lexports.js`. Fixes #94939. See emscripten-core/emscripten#20762 --- src/mono/wasm/build/WasmApp.Native.targets | 2 +- src/mono/wasm/wasm.proj | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mono/wasm/build/WasmApp.Native.targets b/src/mono/wasm/build/WasmApp.Native.targets index 9f3e488d2ac97c..3fa6fc6ccda12c 100644 --- a/src/mono/wasm/build/WasmApp.Native.targets +++ b/src/mono/wasm/build/WasmApp.Native.targets @@ -255,7 +255,7 @@ <_EmccLDFlags Include="$(EmccLinkOptimizationFlag)" /> <_EmccLDFlags Include="@(_EmccCommonFlags)" /> - <_EmccLDFlags Include="-s EXPORT_ES6=1" /> + <_EmccLDFlags Include="-s EXPORT_ES6=1 -lexports.js" /> <_EmccLDFlags Condition="'$(WasmEnableExceptionHandling)' != 'false'" Include="-s EXPORT_EXCEPTION_HANDLING_HELPERS=1" /> <_DriverCDependencies Include="$(_WasmPInvokeHPath);$(_WasmICallTablePath)" /> diff --git a/src/mono/wasm/wasm.proj b/src/mono/wasm/wasm.proj index d741533a238250..1e349920cf35e0 100644 --- a/src/mono/wasm/wasm.proj +++ b/src/mono/wasm/wasm.proj @@ -374,7 +374,8 @@ $(CMakeConfigurationEmccFlags) -s ASSERTIONS=1 -O2 - $(CMakeConfigurationLinkFlags) -s EXPORT_ES6=1 + + $(CMakeConfigurationLinkFlags) -s EXPORT_ES6=1 -lexports.js $(CMakeConfigurationLinkFlags) -msimd128 $(CMakeConfigurationLinkFlags) -Wno-pthreads-mem-growth $(CMakeConfigurationLinkFlags) --emit-symbol-map