Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Emscripten 2.0.34 bump #62499

Merged
merged 28 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0a6c904
Initial changes for emscripten 2.0.34
radekdoulik Dec 7, 2021
1c2f989
Use emcc-link.rsp in build targets
radekdoulik Dec 8, 2021
f74d8b9
Use updated docker images
radekdoulik Dec 8, 2021
20f59e5
Fix compiler warnings
Dec 9, 2021
31197d9
Put `--profiling-funcs` to `_EmccLinkFlags`
radekdoulik Dec 9, 2021
2063241
Fix build
radekdoulik Dec 9, 2021
6aed1c5
Add shell to the environment
radekdoulik Dec 13, 2021
1f0048f
Merge remote-tracking branch 'origin/main' into pr-emscripten-34-bump
radekdoulik Dec 21, 2021
17c0117
Merge remote-tracking branch 'remotes/origin/main' into pr-emscripten…
radekdoulik Jan 3, 2022
11e2ce5
Add emcc-link.rsp to PlatformManifestFileEntry
radekdoulik Jan 4, 2022
3eb44cf
Feedback
radekdoulik Jan 7, 2022
e189182
Use new Emscripten workload
radekdoulik Jan 31, 2022
2f3227a
Merge remote-tracking branch 'remotes/origin/main' into pr-emscripten…
radekdoulik Jan 31, 2022
4ffd9a0
Remove unused variable
radekdoulik Jan 20, 2022
38a7107
Add the emcc-link.rsp
lewing Jan 31, 2022
afabf1c
Bump dotnet icu
radekdoulik Feb 1, 2022
5318de4
Merge remote-tracking branch 'remotes/origin/main' into pr-emscripten…
radekdoulik Feb 1, 2022
1e3a947
Merge branch 'main' into pr-emscripten-34-bump
lewing Feb 1, 2022
55cb081
Merge remote-tracking branch 'origin/main' into pr-emscripten-34-bump
radical Feb 2, 2022
16496b8
Feedback
radekdoulik Feb 2, 2022
2c81e67
Merge remote-tracking branch 'remotes/origin/main' into pr-emscripten…
radekdoulik Feb 2, 2022
814279b
Do not add linker flags to compilation
radekdoulik Feb 2, 2022
a54d310
Split `_EmccLDFlags`
radekdoulik Feb 2, 2022
4fb4543
Merge remote-tracking branch 'remotes/origin/main' into pr-emscripten…
radekdoulik Feb 2, 2022
56460a5
Bump emscripten workload
radekdoulik Feb 2, 2022
1c2f7a5
Update windows helix queues
Feb 2, 2022
6ab30fc
Merge branch 'main' into pr-emscripten-34-bump
lewing Feb 2, 2022
e411b47
[wasm] Fix WBT running with nodejs
radical Feb 3, 2022
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/pipelines/common/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ jobs:
targetRid: browser-wasm
platform: Browser_wasm
container:
image: ubuntu-18.04-webassembly-20210531091624-f5c7a43
image: ubuntu-18.04-webassembly-20211208134944-544b18c
registry: mcr
jobParameters:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/libraries/helix-queues-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,6 @@ jobs:

# WebAssembly windows
- ${{ if eq(parameters.platform, 'Browser_wasm_win') }}:
- (Windows.Server.Core.1909.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:windowsservercore-2004-helix-webassembly-amd64-20210702131541-6837048
- (Windows.Server.Core.1909.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:windowsservercore-2004-helix-webassembly-amd64-20211208140215-544b18c

${{ insert }}: ${{ parameters.jobParameters }}
37 changes: 0 additions & 37 deletions src/mono/mono/mini/mini-wasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,6 @@ mono_arch_patch_code_new (MonoCompile *cfg, guint8 *code, MonoJumpInfo *ji, gpoi

G_BEGIN_DECLS

void * getgrnam (const char *name);
void * getgrgid (gid_t gid);
int inotify_init (void);
int inotify_rm_watch (int fd, int wd);
int inotify_add_watch (int fd, const char *pathname, uint32_t mask);
Expand Down Expand Up @@ -707,13 +705,6 @@ pthread_setschedparam(pthread_t thread, int policy, const struct sched_param *pa
return 0;
}

int
pthread_sigmask (int how, const sigset_t *set, sigset_t *oset)
{
return 0;
}


int
sigsuspend(const sigset_t *sigmask)
{
Expand All @@ -727,18 +718,6 @@ getdtablesize (void)
return 256; //random constant that is the fd limit
}

void *
getgrnam (const char *name)
{
return NULL;
}

void *
getgrgid (gid_t gid)
{
return NULL;
}

int
inotify_init (void)
{
Expand Down Expand Up @@ -776,22 +755,6 @@ ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count)
return -1;
}

int
getpwnam_r (const char *name, struct passwd *pwd, char *buffer, size_t bufsize,
struct passwd **result)
{
*result = NULL;
return ENOTSUP;
}

int
getpwuid_r (uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize,
struct passwd **result)
{
*result = NULL;
return ENOTSUP;
}

G_END_DECLS

/* Helper for runtime debugging */
Expand Down
6 changes: 4 additions & 2 deletions src/mono/wasm/build/WasmApp.Native.targets
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
<PropertyGroup>
<_MonoAotCrossCompilerPath>@(MonoAotCrossCompiler->WithMetadataValue('RuntimeIdentifier','browser-wasm'))</_MonoAotCrossCompilerPath>
<_EmccDefaultFlagsRsp>$([MSBuild]::NormalizePath($(_WasmRuntimePackSrcDir), 'emcc-default.rsp'))</_EmccDefaultFlagsRsp>
<_EmccDefaultLinkFlagsRsp>$([MSBuild]::NormalizePath($(_WasmRuntimePackSrcDir), 'emcc-link.rsp'))</_EmccDefaultLinkFlagsRsp>
<WasmNativeStrip Condition="'$(WasmNativeStrip)' == '' and '$(Configuration)' == 'Debug' and '$(WasmBuildingForNestedPublish)' != 'true'">false</WasmNativeStrip>
<WasmNativeStrip Condition="'$(WasmNativeStrip)' == ''">true</WasmNativeStrip>
<WasmNativeDebugSymbols Condition="'$(WasmNativeDebugSymbols)' == ''">true</WasmNativeDebugSymbols>
Expand Down Expand Up @@ -216,6 +217,7 @@
<!-- Adding optimization flag at the top, so it gets precedence -->
<_EmccLDFlags Include="$(EmccLinkOptimizationFlag)" />
<_EmccLDFlags Include="@(_EmccCommonFlags)" />
<_EmccLDFlags Include="-Wl,--allow-undefined" />
<_EmccLDFlags Include="-s TOTAL_MEMORY=$(EmccTotalMemory)" />

<!-- ILLinker should have removed unused imports, so error for Publish -->
Expand Down Expand Up @@ -391,14 +393,14 @@
</Target>

<Target Name="_WasmLinkDotNet"
Inputs="@(_WasmLinkDependencies);$(_EmccDefaultFlagsRsp);$(_EmccLinkRsp)"
Inputs="@(_WasmLinkDependencies);$(_EmccDefaultFlagsRsp);$(_EmccDefaultLinkFlagsRsp);$(_EmccLinkRsp)"
Outputs="$(_WasmIntermediateOutputPath)dotnet.js;$(_WasmIntermediateOutputPath)dotnet.wasm"
DependsOnTargets="_CheckEmccIsExpectedVersion;_WasmSelectRuntimeComponentsForLinking;_WasmCompileAssemblyBitCodeFilesForAOT;_WasmWriteRspFilesForLinking"
Returns="@(FileWrites)" >

<Message Text="Linking with emcc with $(EmccLinkOptimizationFlag). This may take a while ..." Importance="High" />
<Message Text="Running emcc with @(_EmccLinkStepArgs->'%(Identity)', ' ')" Importance="Low" />
<Exec Command='emcc "@$(_EmccDefaultFlagsRsp)" "@$(_EmccLinkRsp)"' EnvironmentVariables="@(EmscriptenEnvVars)" />
<Exec Command='emcc "@$(_EmccDefaultFlagsRsp)" "@$(_EmccDefaultLinkFlagsRsp)" "@$(_EmccLinkRsp)"' EnvironmentVariables="@(EmscriptenEnvVars)" />
<ItemGroup>
<FileWrites Include="$(_WasmIntermediateOutputPath)dotnet.wasm" />
<FileWrites Include="$(_WasmIntermediateOutputPath)dotnet.js" />
Expand Down
2 changes: 1 addition & 1 deletion src/mono/wasm/emscripten-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.23
2.0.34
4 changes: 2 additions & 2 deletions src/mono/wasm/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(CMAKE_EXECUTABLE_SUFFIX ".js")
add_executable(dotnet corebindings.c driver.c pinvoke.c)

target_include_directories(dotnet PUBLIC ${MONO_INCLUDES} ${MONO_OBJ_INCLUDES})
target_compile_options(dotnet PUBLIC @${NATIVE_BIN_DIR}/src/emcc-default.rsp -DCORE_BINDINGS -DGEN_PINVOKE=1)
target_compile_options(dotnet PUBLIC @${NATIVE_BIN_DIR}/src/emcc-default.rsp @${NATIVE_BIN_DIR}/src/emcc-compile.rsp -DCORE_BINDINGS -DGEN_PINVOKE=1)

set_target_properties(dotnet PROPERTIES COMPILE_FLAGS ${CONFIGURATION_EMCC_FLAGS})

Expand All @@ -25,7 +25,7 @@ target_link_libraries(dotnet

set_target_properties(dotnet PROPERTIES
LINK_DEPENDS "${NATIVE_BIN_DIR}/src/emcc-default.rsp;${NATIVE_BIN_DIR}/src/cjs/dotnet.cjs.pre.js;${NATIVE_BIN_DIR}/src/cjs/runtime.cjs.iffe.js;${NATIVE_BIN_DIR}/src/cjs/dotnet.cjs.lib.js;${NATIVE_BIN_DIR}/src/pal_random.lib.js;${NATIVE_BIN_DIR}/src/cjs/dotnet.cjs.post.js;${NATIVE_BIN_DIR}/src/cjs/dotnet.cjs.extpost.js;"
LINK_FLAGS "@${NATIVE_BIN_DIR}/src/emcc-default.rsp ${CONFIGURATION_LINK_FLAGS} -DENABLE_NETCORE=1 --extern-pre-js ${NATIVE_BIN_DIR}/src/cjs/runtime.cjs.iffe.js --pre-js ${NATIVE_BIN_DIR}/src/cjs/dotnet.cjs.pre.js --js-library ${NATIVE_BIN_DIR}/src/cjs/dotnet.cjs.lib.js --js-library ${NATIVE_BIN_DIR}/src/pal_random.lib.js --post-js ${NATIVE_BIN_DIR}/src/cjs/dotnet.cjs.post.js --extern-post-js ${NATIVE_BIN_DIR}/src/cjs/dotnet.cjs.extpost.js "
LINK_FLAGS "@${NATIVE_BIN_DIR}/src/emcc-default.rsp @${NATIVE_BIN_DIR}/src/emcc-link.rsp ${CONFIGURATION_LINK_FLAGS} -DENABLE_NETCORE=1 --extern-pre-js ${NATIVE_BIN_DIR}/src/cjs/runtime.cjs.iffe.js --pre-js ${NATIVE_BIN_DIR}/src/cjs/dotnet.cjs.pre.js --js-library ${NATIVE_BIN_DIR}/src/cjs/dotnet.cjs.lib.js --js-library ${NATIVE_BIN_DIR}/src/pal_random.lib.js --post-js ${NATIVE_BIN_DIR}/src/cjs/dotnet.cjs.post.js --extern-post-js ${NATIVE_BIN_DIR}/src/cjs/dotnet.cjs.extpost.js "
RUNTIME_OUTPUT_DIRECTORY "${NATIVE_BIN_DIR}")

if(CMAKE_BUILD_TYPE STREQUAL "Release")
Expand Down
33 changes: 23 additions & 10 deletions src/mono/wasm/wasm.proj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<EmccCmd>emcc</EmccCmd>
<WasmObjDir>$(ArtifactsObjDir)wasm</WasmObjDir>
<_EmccDefaultsRspPath>$(NativeBinDir)src\emcc-default.rsp</_EmccDefaultsRspPath>
<_EmccCompileRspPath>$(NativeBinDir)src\emcc-compile.rsp</_EmccCompileRspPath>
<_EmccLinkRspPath>$(NativeBinDir)src\emcc-link.rsp</_EmccLinkRspPath>
<WasmNativeStrip Condition="'$(ContinuousIntegrationBuild)' == 'true'">false</WasmNativeStrip>
</PropertyGroup>

Expand Down Expand Up @@ -64,17 +66,18 @@

<Target Name="GenerateEmccPropsAndRspFiles">
<ItemGroup>
<_EmccCommonFlags Include="-s ALLOW_MEMORY_GROWTH=1" />
<_EmccCommonFlags Include="-s NO_EXIT_RUNTIME=1" />
<_EmccCommonFlags Include="-s FORCE_FILESYSTEM=1" />
<_EmccCommonFlags Include="-s EXPORTED_RUNTIME_METHODS=&quot;['FS','print','ccall','cwrap','setValue','getValue','UTF8ToString','UTF8ArrayToString','FS_createPath','FS_createDataFile','removeRunDependency','addRunDependency']&quot;" />
<_EmccCommonFlags Include="-s EXPORTED_FUNCTIONS=&quot;['_free','_malloc']&quot;" />
<_EmccCommonFlags Include="--source-map-base http://example.com" />

<_EmccCommonFlags Include="-s STRICT_JS=1" />
<_EmccCommonFlags Include="-s EXPORT_NAME=&quot;'createDotnetRuntime'&quot;" />
<_EmccCommonFlags Include="-s MODULARIZE=1"/>
<_EmccCommonFlags Include="-s EXPORT_ES6=1" Condition="'$(WasmEnableES6)' == 'true'" />
radekdoulik marked this conversation as resolved.
Show resolved Hide resolved

<_EmccLinkFlags Include="-s ALLOW_MEMORY_GROWTH=1" />
<_EmccLinkFlags Include="-s NO_EXIT_RUNTIME=1" />
<_EmccLinkFlags Include="-s FORCE_FILESYSTEM=1" />
<_EmccLinkFlags Include="-s EXPORTED_RUNTIME_METHODS=&quot;['FS','print','ccall','cwrap','setValue','getValue','UTF8ToString','UTF8ArrayToString','FS_createPath','FS_createDataFile','removeRunDependency','addRunDependency']&quot;" />
<_EmccLinkFlags Include="-s EXPORTED_FUNCTIONS=&quot;['_free','_malloc']&quot;" />
<_EmccLinkFlags Include="--source-map-base http://example.com" />
<_EmccLinkFlags Include="-s STRICT_JS=1" />
<_EmccLinkFlags Include="-s EXPORT_NAME=&quot;'createDotnetRuntime'&quot;" />
<_EmccLinkFlags Include="-s MODULARIZE=1"/>
<_EmccLinkFlags Include="-Wl,--allow-undefined"/>
</ItemGroup>

<ItemGroup Condition="'$(OS)' != 'Windows_NT'">
Expand All @@ -91,6 +94,14 @@
Lines="@(_EmccFlags)"
WriteOnlyWhenDifferent="true"
Overwrite="true" />
<WriteLinesToFile File="$(_EmccCompileRspPath)"
Lines="@(_EmccCompileFlags)"
WriteOnlyWhenDifferent="true"
Overwrite="true" />
<WriteLinesToFile File="$(_EmccLinkRspPath)"
Lines="@(_EmccLinkFlags)"
WriteOnlyWhenDifferent="true"
Overwrite="true" />

<!-- Generate emcc-props.json -->

Expand Down Expand Up @@ -217,6 +228,8 @@
<WasmSrcFiles Include="$(NativeBinDir)src\*.c;
$(NativeBinDir)src\*.js;
$(_EmccDefaultsRspPath);
$(_EmccCompileRspPath);
$(_EmccLinkRspPath);
$(NativeBinDir)src\emcc-props.json" />
<WasmSrcFilesCjs Include="$(NativeBinDir)src\cjs\*.js;" />
<WasmSrcFilesEs6 Include="$(NativeBinDir)src\es6\*.js;" />
Expand Down