diff --git a/src/mono/wasi/wasi.proj b/src/mono/wasi/wasi.proj
index d601f2c9e09ab6..611d7969f034b8 100644
--- a/src/mono/wasi/wasi.proj
+++ b/src/mono/wasi/wasi.proj
@@ -218,7 +218,6 @@
$(CMakeBuildRuntimeConfigureCmd) -DICU_LIB_DIR="$(ICULibDir.TrimEnd('\/'))"
$(CMakeBuildRuntimeConfigureCmd) -DMONO_ARTIFACTS_DIR="$(MonoArtifactsPath.TrimEnd('\/'))"
$(CMakeBuildRuntimeConfigureCmd) -DNATIVE_BIN_DIR="$(NativeBinDir.TrimEnd('\/'))"
- $(CMakeBuildRuntimeConfigureCmd) -DWASM_OPT_ADDITIONAL_FLAGS="--enable-simd"
$(CMakeBuildRuntimeConfigureCmd) -DDISABLE_THREADS=0
call "$(RepositoryEngineeringDir)native\init-vs-env.cmd" wasm && $(CMakeBuildRuntimeConfigureCmd)
diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs b/src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs
index 96183d8cdeac74..de1a5683138ab8 100644
--- a/src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs
+++ b/src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs
@@ -24,7 +24,6 @@ public WasmSIMDTests(ITestOutputHelper output, SharedBuildPerTestClassFixture bu
[Theory]
[MemberData(nameof(MainMethodSimdTestData), parameters: new object[] { /*aot*/ false, RunHost.All, true /* simd */ })]
- [MemberData(nameof(MainMethodSimdTestData), parameters: new object[] { /*aot*/ false, RunHost.All, false /* simd */ })]
public void Build_NoAOT_ShouldNotRelink(BuildArgs buildArgs, RunHost host, string id)
{
string projectName = $"build_with_workload_no_aot";
diff --git a/src/mono/wasm/build/WasmApp.Native.targets b/src/mono/wasm/build/WasmApp.Native.targets
index 34736613dd8f6a..877c420b891482 100644
--- a/src/mono/wasm/build/WasmApp.Native.targets
+++ b/src/mono/wasm/build/WasmApp.Native.targets
@@ -24,6 +24,7 @@
_SetWasmBuildNativeDefaults
+ <_EmccDefaultFlags Condition="'$(WasmEnableSIMD)' == 'true'">-msimd128
<_ExeExt Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">.exe
true
@@ -115,6 +116,12 @@
true
+
+ true
+
+
+ true
+
true
true
@@ -213,7 +220,6 @@
<_EmccCommonFlags Include="-v" Condition="'$(EmccVerbose)' != 'false'" />
<_EmccCommonFlags Include="-s DISABLE_EXCEPTION_CATCHING=0" Condition="'$(WasmEnableExceptionHandling)' == 'false'" />
<_EmccCommonFlags Include="-fwasm-exceptions" Condition="'$(WasmEnableExceptionHandling)' == 'true'" />
- <_EmccCommonFlags Include="-msimd128" Condition="'$(WasmEnableSIMD)' == 'true' and '$(_WasmShouldAOT)' == 'true'" />
<_EmccIncludePaths Include="$(_WasmIntermediateOutputPath.TrimEnd('\/'))" />
<_EmccIncludePaths Include="$(_WasmRuntimePackIncludeDir)mono-2.0" />
@@ -345,7 +351,7 @@
@@ -367,7 +373,7 @@
@@ -483,7 +489,7 @@
-
+
diff --git a/src/mono/wasm/runtime/CMakeLists.txt b/src/mono/wasm/runtime/CMakeLists.txt
index 6d76868952e0cd..6b8ef873ec27da 100644
--- a/src/mono/wasm/runtime/CMakeLists.txt
+++ b/src/mono/wasm/runtime/CMakeLists.txt
@@ -9,7 +9,7 @@ set(CMAKE_EXECUTABLE_SUFFIX ".js")
add_executable(dotnet.native corebindings.c driver.c pinvoke.c)
target_include_directories(dotnet.native PUBLIC ${MONO_INCLUDES} ${MONO_OBJ_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}/include/wasm)
-target_compile_options(dotnet.native PUBLIC @${NATIVE_BIN_DIR}/src/emcc-default.rsp @${NATIVE_BIN_DIR}/src/emcc-compile.rsp -DGEN_PINVOKE=1)
+target_compile_options(dotnet.native PUBLIC @${NATIVE_BIN_DIR}/src/emcc-default.rsp @${NATIVE_BIN_DIR}/src/emcc-compile.rsp -DGEN_PINVOKE=1 ${CONFIGURATION_COMPILE_OPTIONS})
set_target_properties(dotnet.native PROPERTIES COMPILE_FLAGS ${CONFIGURATION_EMCC_FLAGS})
@@ -38,7 +38,7 @@ set_target_properties(dotnet.native PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${NATIVE_BIN_DIR}")
set(ignoreMeWasmOptFlags "${CONFIGURATION_WASM_OPT_FLAGS}")
-set(ignoreMeWasmOptAdditionalFlags "${WASM_OPT_ADDITIONAL_FLAGS}")
+set(ignoreMeWasmOptAdditionalFlags "${CONFIGURATION_COMPILE_OPTIONS}")
set(ignoreMeEmsdkPath "${EMSDK_PATH}")
if(CMAKE_BUILD_TYPE STREQUAL "Release")
diff --git a/src/mono/wasm/wasm.proj b/src/mono/wasm/wasm.proj
index c479a8cddf72e4..0b0f9fb7003234 100644
--- a/src/mono/wasm/wasm.proj
+++ b/src/mono/wasm/wasm.proj
@@ -270,7 +270,6 @@
<_EmccLinkFlags Include="-s INITIAL_MEMORY=$(EmccInitialHeapSize)" />
<_EmccLinkFlags Include="-s STACK_SIZE=$(EmccStackSize)" />
- <_EmccCommonFlags Include="-msimd128" />
<_EmccCommonFlags Condition="'$(MonoWasmThreads)' == 'true'" Include="-s USE_PTHREADS=1" />
<_EmccLinkFlags Condition="'$(MonoWasmThreads)' == 'true'" Include="-Wno-pthreads-mem-growth" />
<_EmccLinkFlags Condition="'$(MonoWasmThreads)' == 'true'" Include="-s PTHREAD_POOL_SIZE=0" />
@@ -372,6 +371,7 @@
-O2
$(CMakeConfigurationLinkFlags) -s EXPORT_ES6=1
+ $(CMakeConfigurationLinkFlags) -msimd128
$(CMakeConfigurationLinkFlags) -Wno-pthreads-mem-growth
$(CMakeConfigurationLinkFlags) --emit-symbol-map
@@ -387,7 +387,7 @@
$(CMakeBuildRuntimeConfigureCmd) -DICU_LIB_DIR="$(ICULibDir.TrimEnd('\/').Replace('\','/'))"
$(CMakeBuildRuntimeConfigureCmd) -DMONO_ARTIFACTS_DIR="$(MonoArtifactsPath.TrimEnd('\/').Replace('\','/'))"
$(CMakeBuildRuntimeConfigureCmd) -DNATIVE_BIN_DIR="$(NativeBinDir.TrimEnd('\/').Replace('\','/'))"
- $(CMakeBuildRuntimeConfigureCmd) -DWASM_OPT_ADDITIONAL_FLAGS="--enable-simd"
+ $(CMakeBuildRuntimeConfigureCmd) -DCONFIGURATION_COMPILE_OPTIONS="-msimd128"
$(CMakeBuildRuntimeConfigureCmd) -DDISABLE_THREADS=0
$(CMakeBuildRuntimeConfigureCmd) -DDISABLE_LEGACY_JS_INTEROP=1
$(CMakeBuildRuntimeConfigureCmd) $(CMakeConfigurationEmsdkPath)