Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ else()
if(CLR_CMAKE_TARGET_BROWSER)
add_link_options(-fwasm-exceptions)
add_link_options(-Wno-unused-command-line-argument)
add_link_options(-Wl,-error-limit=0)
add_link_options(-Wl,--error-limit=0)

add_link_options(-nostdlib)
add_link_options(-lbulkmemory)
Expand Down
4 changes: 2 additions & 2 deletions eng/native/gen-buildsys.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ if /i "%__Os%" == "browser" (
echo Error: Should set EMSDK_PATH environment variable pointing to emsdk root.
exit /B 1
)
set EMSDK_QUIET=1 && call "%__repoRoot%\src\mono\browser\emsdk\emsdk_env"
set "EMSDK_QUIET=1" && call "%__repoRoot%\src\mono\browser\emsdk\emsdk_env.cmd"
) else (
set EMSDK_QUIET=1 && call "%EMSDK_PATH%\emsdk_env"
set "EMSDK_QUIET=1" && call "%EMSDK_PATH%\emsdk_env.cmd"
Comment thread
pavelsavara marked this conversation as resolved.
)
)

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/hosts/corerun/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ else()
-sEXPORTED_FUNCTIONS=_main,___stack_pointer,${CMAKE_EMCC_EXPORTED_FUNCTIONS}
-sEXPORT_NAME=createDotnetRuntime
-sENVIRONMENT=node,shell,web
-Wl,-error-limit=0)
-Wl,--error-limit=0)

if (CORERUN_IN_BROWSER)
# Node.js doesn't have good support for WASM_BIGINT
Expand Down
15 changes: 11 additions & 4 deletions src/mono/browser/browser.proj
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@
<EmccExportedRuntimeMethod Include="runtimeKeepalivePop" />
<EmccExportedRuntimeMethod Include="maybeExit" />
<EmccExportedRuntimeMethod Include="abort" />
<EmccExportedRuntimeMethod Include="HEAP8" />
<EmccExportedRuntimeMethod Include="HEAP16" />
<EmccExportedRuntimeMethod Include="HEAPU8" />
<EmccExportedRuntimeMethod Include="HEAPU16" />
<EmccExportedRuntimeMethod Include="HEAP32" />
<EmccExportedRuntimeMethod Include="HEAPU32" />
<EmccExportedRuntimeMethod Include="HEAPF32" />
<EmccExportedRuntimeMethod Include="HEAPF64" />
<EmccExportedRuntimeMethod Include="HEAP64" />
<EmccExportedRuntimeMethod Include="HEAPU64" />

<EmccExportedFunction Include="_free" />
<EmccExportedFunction Include="_htons" />
Expand Down Expand Up @@ -236,10 +246,7 @@
</ItemGroup>

<ItemGroup Condition="'$(WasmEnableThreads)' == 'true'">
<WasmOptConfigurationFlags Include="--enable-threads;--enable-bulk-memory;--enable-sign-ext" />

<!-- workaround for https://github.com/emscripten-core/emscripten/issues/18034 -->
<_EmccLinkFlags Include="-s TEXTDECODER=0"/>
<WasmOptConfigurationFlags Include="--enable-threads;--enable-bulk-memory;--enable-nontrapping-float-to-int;--enable-sign-ext" />
</ItemGroup>

<ItemGroup Condition="'$(OS)' != 'Windows_NT'">
Expand Down
2 changes: 1 addition & 1 deletion src/mono/browser/build/BrowserWasmApp.CoreCLR.targets
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@
<_EmccLinkStepArgs Include="$(EmccExtraLDFlags)" />

<!-- Linker error limit -->
<_EmccLinkStepArgs Include="-Wl,-error-limit=0" />
<_EmccLinkStepArgs Include="-Wl,--error-limit=0" />
</ItemGroup>

<!-- Collect all link dependencies for incremental build -->
Expand Down
2 changes: 1 addition & 1 deletion src/mono/browser/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ set(ignoreMeEmsdkPath "${EMSDK_PATH}")

if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_custom_command(TARGET dotnet.native
POST_BUILD COMMAND ${EMSDK_PATH}/bin/wasm-opt --enable-exception-handling --enable-simd --enable-bulk-memory ${CONFIGURATION_WASM_OPT_FLAGS} --strip-dwarf ${NATIVE_BIN_DIR}/dotnet.native.wasm -o ${NATIVE_BIN_DIR}/dotnet.native.wasm
POST_BUILD COMMAND ${EMSDK_PATH}/bin/wasm-opt --enable-exception-handling --enable-simd --enable-bulk-memory --enable-nontrapping-float-to-int ${CONFIGURATION_WASM_OPT_FLAGS} --strip-dwarf ${NATIVE_BIN_DIR}/dotnet.native.wasm -o ${NATIVE_BIN_DIR}/dotnet.native.wasm
COMMENT "Stripping debug symbols from dotnet.native.wasm using wasm-opt")
endif()

Expand Down
9 changes: 2 additions & 7 deletions src/mono/mono/mini/llvm-intrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,12 @@ INTRINS(AESNI_AESDECLAST, x86_aesni_aesdeclast, X86)
INTRINS(AESNI_AESENC, x86_aesni_aesenc, X86)
INTRINS(AESNI_AESENCLAST, x86_aesni_aesenclast, X86)
INTRINS(AESNI_AESIMC, x86_aesni_aesimc, X86)

#endif
#if defined(TARGET_AMD64) || defined(TARGET_X86) || defined(TARGET_WASM)
INTRINS_OVR(SSE_SSUB_SATI8, ssub_sat, Generic, v128_i1_t)
INTRINS_OVR(SSE_USUB_SATI8, usub_sat, Generic, v128_i1_t)
INTRINS_OVR(SSE_SSUB_SATI16, ssub_sat, Generic, v128_i2_t)
INTRINS_OVR(SSE_USUB_SATI16, usub_sat, Generic, v128_i2_t)
#endif
#if defined(TARGET_AMD64) || defined(TARGET_X86) || defined(TARGET_WASM)
INTRINS_OVR(SSE_SADD_SATI8, sadd_sat, Generic, v128_i1_t)
INTRINS_OVR(SSE_UADD_SATI8, uadd_sat, Generic, v128_i1_t)
INTRINS_OVR(SSE_SADD_SATI16, sadd_sat, Generic, v128_i2_t)
Expand Down Expand Up @@ -298,10 +297,6 @@ INTRINS_OVR(WASM_PMAX_V4, fabs, Generic, sse_r4_t)
INTRINS_OVR(WASM_PMAX_V2, fabs, Generic, sse_r8_t)
INTRINS(WASM_Q15MULR_SAT_SIGNED, wasm_q15mulr_sat_signed, Wasm)
INTRINS(WASM_SHUFFLE, wasm_shuffle, Wasm)
INTRINS_OVR(WASM_SUB_SAT_SIGNED_V16, wasm_sub_sat_signed, Wasm, sse_i1_t)
INTRINS_OVR(WASM_SUB_SAT_SIGNED_V8, wasm_sub_sat_signed, Wasm, sse_i2_t)
INTRINS_OVR(WASM_SUB_SAT_UNSIGNED_V16, wasm_sub_sat_unsigned, Wasm, sse_i1_t)
INTRINS_OVR(WASM_SUB_SAT_UNSIGNED_V8, wasm_sub_sat_unsigned, Wasm, sse_i2_t)
INTRINS(WASM_SWIZZLE, wasm_swizzle, Wasm)
INTRINS(WASM_GET_EXCEPTION, wasm_get_exception, Wasm)
INTRINS(WASM_GET_EHSELECTOR, wasm_get_ehselector, Wasm)
Expand Down
8 changes: 4 additions & 4 deletions src/mono/mono/mini/simd-intrinsics.c
Original file line number Diff line number Diff line change
Expand Up @@ -6823,16 +6823,16 @@ emit_wasm_supported_intrinsics (

switch (arg0_type) {
case MONO_TYPE_I1:
c0 = INTRINS_WASM_SUB_SAT_SIGNED_V16;
c0 = INTRINS_SSE_SSUB_SATI8;
break;
case MONO_TYPE_I2:
c0 = INTRINS_WASM_SUB_SAT_SIGNED_V8;
c0 = INTRINS_SSE_SSUB_SATI16;
break;
case MONO_TYPE_U1:
c0 = INTRINS_WASM_SUB_SAT_UNSIGNED_V16;
c0 = INTRINS_SSE_USUB_SATI8;
break;
case MONO_TYPE_U2:
c0 = INTRINS_WASM_SUB_SAT_UNSIGNED_V8;
c0 = INTRINS_SSE_USUB_SATI16;
break;
}

Expand Down
2 changes: 1 addition & 1 deletion src/mono/wasi/wasi.proj
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

<!-- Generate wasm-props.json -->
<ItemGroup Condition="'$(WasmEnableThreads)' == 'true'">
<WasmOptConfigurationFlags Include="--enable-threads;--enable-bulk-memory;--enable-sign-ext" />
<WasmOptConfigurationFlags Include="--enable-threads;--enable-bulk-memory;--enable-nontrapping-float-to-int;--enable-sign-ext" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/mono/wasm/build/WasmApp.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -930,8 +930,8 @@
<_WasmOptPostLinkFileName Condition="'$([System.IO.Path]::IsPathRooted($(_WasmOptPostLinkFileName)))' != 'true'">$([System.IO.Path]::Combine($(_WasmIntermediateOutputPath), $(_WasmOptPostLinkFileName)))</_WasmOptPostLinkFileName>
</PropertyGroup>

<Message Text="Running wasm-opt with --enable-simd --enable-exception-handling --enable-bulk-memory @(WasmOptConfigurationFlags, ' ')" Importance="High" />
<Exec Command="wasm-opt$(_ExeExt) --enable-simd --enable-exception-handling --enable-bulk-memory @(WasmOptConfigurationFlags, ' ') &quot;$(_WasmOptPostLinkFileName)&quot; -o &quot;$(_WasmOptPostLinkFileName)&quot;"
<Message Text="Running wasm-opt with --enable-simd --enable-exception-handling --enable-bulk-memory --enable-nontrapping-float-to-int @(WasmOptConfigurationFlags, ' ')" Importance="High" />
<Exec Command="wasm-opt$(_ExeExt) --enable-simd --enable-exception-handling --enable-bulk-memory --enable-nontrapping-float-to-int @(WasmOptConfigurationFlags, ' ') &quot;$(_WasmOptPostLinkFileName)&quot; -o &quot;$(_WasmOptPostLinkFileName)&quot;"
IgnoreStandardErrorWarningFormat="true"
EnvironmentVariables="@(WasmToolchainEnvVars)" />
</Target>
Expand Down
2 changes: 1 addition & 1 deletion src/native/corehost/browserhost/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ target_link_options(browserhost PRIVATE
-sEXPORT_NAME=createDotnetRuntime
-sENVIRONMENT=web,webview,worker,node,shell
--emit-symbol-map
-Wl,-error-limit=0)
-Wl,--error-limit=0)

target_link_libraries(browserhost PRIVATE
BrowserHost-Static
Expand Down
1 change: 1 addition & 0 deletions src/native/libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)
if (CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)
add_compile_options(-Wno-unsafe-buffer-usage)
add_compile_options(-Wno-cast-function-type-strict)
add_compile_options(-Wno-c++-keyword)
endif ()
endif ()

Expand Down
14 changes: 10 additions & 4 deletions src/native/libs/System.Globalization.Native/pal_icushim_static.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
static int32_t isLoaded = 0;
static int32_t isDataSet = 0;

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wjump-misses-init"
#endif
Comment thread
pavelsavara marked this conversation as resolved.

static void log_shim_error(const char* format, ...)
{
va_list args;
Expand Down Expand Up @@ -83,7 +88,7 @@ int32_t mono_wasi_load_icu_data(const void* pData)
static int32_t load_icu_data(const void* pData)
{

UErrorCode status = 0;
UErrorCode status = U_ZERO_ERROR;
udata_setCommonData(pData, &status);

if (U_FAILURE(status))
Expand All @@ -108,6 +113,7 @@ static const char *
cstdlib_load_icu_data(const char *path)
{
char *file_buf = NULL;
long file_buf_size = 0;
FILE *fp = fopen(path, "rb");

if (fp == NULL)
Expand All @@ -122,15 +128,15 @@ cstdlib_load_icu_data(const char *path)
goto error;
}

long file_buf_size = ftell(fp);
file_buf_size = ftell(fp);

if (file_buf_size == -1)
{
log_shim_error("Unable to determine size of the ICU dat file.");
goto error;
}

file_buf = malloc(sizeof(char) * (unsigned long)(file_buf_size + 1));
file_buf = (char *)malloc(sizeof(char) * (unsigned long)(file_buf_size + 1));

if (file_buf == NULL)
{
Expand Down Expand Up @@ -223,7 +229,7 @@ int32_t GlobalizationNative_LoadICU(void)
}
#endif

UErrorCode status = 0;
UErrorCode status = U_ZERO_ERROR;
UVersionInfo version;
// Request the CLDR version to perform basic ICU initialization and find out
// whether it worked.
Expand Down
4 changes: 4 additions & 0 deletions src/native/libs/System.Native/pal_networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ extern int getdomainname(char *name, int namelen);
#include <linux/icmp.h>
#endif

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wjump-misses-init"
#endif
Comment thread
pavelsavara marked this conversation as resolved.

#if HAVE_KQUEUE
#if KEVENT_HAS_VOID_UDATA
Expand Down
5 changes: 5 additions & 0 deletions src/native/libs/System.Native/pal_threading.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
#endif
#include <pthread.h>

#if defined(__clang__)
#pragma clang diagnostic push
Comment thread
pavelsavara marked this conversation as resolved.
#pragma clang diagnostic ignored "-Wjump-misses-init"
#endif
Comment thread
pavelsavara marked this conversation as resolved.

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// LowLevelMonitor - Represents a non-recursive mutex and condition

Expand Down
Loading