diff --git a/src/mono/wasi/build/WasiApp.targets b/src/mono/wasi/build/WasiApp.targets
index 9e499a7c8029af..e54fbe4f89ac1a 100644
--- a/src/mono/wasi/build/WasiApp.targets
+++ b/src/mono/wasi/build/WasiApp.targets
@@ -190,6 +190,8 @@
<_WasiClangCFlags Include=""-I%(_WasmCommonIncludePaths.Identity)"" />
<_WasiClangCFlags Include="-I"$(MicrosoftNetCoreAppRuntimePackRidNativeDir.Replace('\', '/'))include"" />
+ <_WasiClangCFlags Include="-g" Condition="'$(WasmNativeDebugSymbols)' == 'true'" />
+
<_WasiClangCFlags Condition="'@(WasiAfterRuntimeLoadedDeclarations)' != ''"
Include="-D WASI_AFTER_RUNTIME_LOADED_DECLARATIONS="@(WasiAfterRuntimeLoadedDeclarations, ' ')"" />
<_WasiClangCFlags Condition="'@(WasiAfterRuntimeLoadedCalls)' != ''"
diff --git a/src/mono/wasm/build/BrowserWasmApp.targets b/src/mono/wasm/build/BrowserWasmApp.targets
index 3135d39af31aa6..bded4ae2b44993 100644
--- a/src/mono/wasm/build/BrowserWasmApp.targets
+++ b/src/mono/wasm/build/BrowserWasmApp.targets
@@ -31,7 +31,6 @@
true
true
false
- true
false
@@ -288,7 +287,7 @@
<_EmccCommonFlags Include="$(_DefaultEmccFlags)" />
<_EmccCommonFlags Include="$(EmccFlags)" />
- <_EmccCommonFlags Include="-g" Condition="'$(WasmNativeDebugSymbols)' == 'true'" />
+ <_EmccCommonFlags Include="-g" Condition="'$(WasmNativeStrip)' == 'false'" />
<_EmccCommonFlags Include="-v" Condition="'$(EmccVerbose)' != 'false'" />
<_EmccCommonFlags Include="-s DISABLE_EXCEPTION_CATCHING=0" Condition="'$(WasmEnableExceptionHandling)' == 'false'" />
<_EmccCommonFlags Include="-fwasm-exceptions" Condition="'$(WasmEnableExceptionHandling)' == 'true'" />
@@ -317,11 +316,12 @@
<_EmccCFlags Include="-emit-llvm" />
<_EmccCFlags Include=""-I%(_EmccIncludePaths.Identity)"" />
+ <_EmccCFlags Include="-g" Condition="'$(WasmNativeDebugSymbols)' == 'true'" />
<_EmccLDFlags Include="$(WasmLinkOptimizationFlag)" />
<_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" />
<_RuntimeCDependencies Include="$(_WasmPInvokeHPath);$(_WasmICallTablePath)" />
diff --git a/src/mono/wasm/build/WasmApp.Common.targets b/src/mono/wasm/build/WasmApp.Common.targets
index 9aee139f2df65a..ba7cf7f700ac31 100644
--- a/src/mono/wasm/build/WasmApp.Common.targets
+++ b/src/mono/wasm/build/WasmApp.Common.targets
@@ -117,7 +117,6 @@
$(PrepareInputsForWasmBuildDependsOn);
_SetupToolchain;
_SetWasmBuildNativeDefaults;
- _SetWasmNativeStripDefault;
_GetDefaultWasmAssembliesToBundle;
_WasmGetRuntimeConfigPath;
_ReadWasmProps;
@@ -516,7 +515,6 @@
true
true
- false
@@ -531,15 +529,20 @@
true
+
+
false
-
-
+
+
+ true
+ false
+
+
-
- false
+ true
true