Skip to content

Commit 724c4e1

Browse files
radekdoulikRadek Doulikvargazlewingradical
authored
[wasm] Emscripten 2.0.34 bump (#62499)
* Initial changes for emscripten 2.0.34 * Use emcc-link.rsp in build targets * Use updated docker images * Fix compiler warnings Co-authored-by: Zoltan Varga <vargaz@gmail.com> * Put `--profiling-funcs` to `_EmccLinkFlags` * Fix build src/mono/mono/mini/mini-runtime.c:3407:25: error: ‘invoke’ undeclared (first use in this function); did you mean ‘revoke’? 3407 | invoke = mono_marshal_get_runtime_invoke_dynamic (); * Add shell to the environment Environment setting https://github.com/emscripten-core/emscripten/blob/2.0.34/src/settings.js#L616-L641 From emscripten 2.0.25 release notes - Support for the 'shell' environment is now disabled by default. Running under `d8`, `js`, or `jsc` is not something that most emscripten users ever want to do, so including the support code is, more often than not, unnecessary. Users who want shell support can enable it by including 'shell' in `-s ENVIRONMENT` (#14535). Example of the the size increase for bench sample: -a--- 12/10/2021 3:35 PM 382113 dotnet.js -a--- 12/13/2021 10:37 AM 383589 dotnet.js * Add emcc-link.rsp to PlatformManifestFileEntry * Feedback https://github.com/emscripten-core/emscripten/blob/2fda25eea756c78c8cb024aa5b6c2b188bf7990f/src/settings.js#L1173-L1176 -s EXPORT_ES6 is link option * Use new Emscripten workload * Remove unused variable * Add the emcc-link.rsp * Bump dotnet icu * Feedback * Do not add linker flags to compilation * Split `_EmccLDFlags` To avoid these errors: WasmApp.Native.targets(342,5): error : Failed to compile .../Microsoft.CodeAnalysis.CSharp.dll.bc -> /datadisks/disk1/work/B9F209B7/w/B1710A2F/e/wasm_build/obj/wasm/for-build/Microsoft.CodeAnalysis.CSharp.dll.o WasmApp.Native.targets(342,5): error : emcc: warning: linker setting ignored during compilation: 'TOTAL_MEMORY' [-Wunused-command-line-argument] WasmApp.Native.targets(342,5): error : emcc: warning: linker setting ignored during compilation: 'ERROR_ON_UNDEFINED_SYMBOLS' [-Wunused-command-line-argument] * Bump emscripten workload * Update windows helix queues * [wasm] Fix WBT running with nodejs When running with nodejs, the managed app would exit with code 42, but node would exit with 1. Use `process.exit` for node, instead of `mono_wasm_exit`. Co-authored-by: Radek Doulik <radekdoulik@google.com> Co-authored-by: Zoltan Varga <vargaz@gmail.com> Co-authored-by: Larry Ewing <lewing@microsoft.com> Co-authored-by: Ankit Jain <radical@gmail.com> Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
1 parent 1df36c7 commit 724c4e1

22 files changed

+92
-88
lines changed

eng/Version.Details.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<Dependencies>
22
<ProductDependencies>
3-
<Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="7.0.0-preview.2.22081.1">
3+
<Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="7.0.0-preview.2.22101.1">
44
<Uri>https://github.com/dotnet/icu</Uri>
5-
<Sha>4f251e7593b1150af58bba4f461698d6d4a1eb95</Sha>
5+
<Sha>cd095b0fb4c6f8adca9e44ef17346b3e13a73a7c</Sha>
66
</Dependency>
77
<Dependency Name="System.Net.MsQuic.Transport" Version="7.0.0-alpha.1.21529.3">
88
<Uri>https://github.com/dotnet/msquic</Uri>
99
<Sha>a7213b4676c1803bb251771291a525482d42e511</Sha>
1010
</Dependency>
11-
<Dependency Name="Microsoft.NET.Workload.Emscripten.Manifest-7.0.100" Version="7.0.0-alpha.2.22077.1">
11+
<Dependency Name="Microsoft.NET.Workload.Emscripten.Manifest-7.0.100" Version="7.0.0-alpha.2.22078.1">
1212
<Uri>https://github.com/dotnet/emsdk</Uri>
13-
<Sha>b2054b98cb7b9e555cbbe19955df823ec81a93ad</Sha>
13+
<Sha>b581f08ff228099e732aa8c8cde53995a5870901</Sha>
1414
</Dependency>
1515
<Dependency Name="System.ServiceModel.Primitives" Version="4.9.0-rc2.21473.1">
1616
<Uri>https://github.com/dotnet/wcf</Uri>

eng/Versions.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
<MicrosoftNETILLinkTasksVersion>7.0.100-1.22078.1</MicrosoftNETILLinkTasksVersion>
181181
<MicrosoftNETILLinkAnalyzerPackageVersion>$(MicrosoftNETILLinkTasksVersion)</MicrosoftNETILLinkAnalyzerPackageVersion>
182182
<!-- ICU -->
183-
<MicrosoftNETCoreRuntimeICUTransportVersion>7.0.0-preview.2.22081.1</MicrosoftNETCoreRuntimeICUTransportVersion>
183+
<MicrosoftNETCoreRuntimeICUTransportVersion>7.0.0-preview.2.22101.1</MicrosoftNETCoreRuntimeICUTransportVersion>
184184
<!-- MsQuic -->
185185
<SystemNetMsQuicTransportVersion>7.0.0-alpha.1.21529.3</SystemNetMsQuicTransportVersion>
186186
<!-- Mono LLVM -->
@@ -193,7 +193,7 @@
193193
<runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>11.1.0-alpha.1.22081.2</runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>
194194
<runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>11.1.0-alpha.1.22081.2</runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>
195195
<!-- emscripten / Node -->
196-
<MicrosoftNETWorkloadEmscriptenManifest70100Version>7.0.0-alpha.2.22077.1</MicrosoftNETWorkloadEmscriptenManifest70100Version>
196+
<MicrosoftNETWorkloadEmscriptenManifest70100Version>7.0.0-alpha.2.22078.1</MicrosoftNETWorkloadEmscriptenManifest70100Version>
197197
<MicrosoftNETRuntimeEmscriptenVersion>$(MicrosoftNETWorkloadEmscriptenManifest70100Version)</MicrosoftNETRuntimeEmscriptenVersion>
198198
<!-- workloads -->
199199
<SwixPackageVersion>1.1.87-gba258badda</SwixPackageVersion>

eng/liveBuilds.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@
190190
$(LibrariesNativeArtifactsPath)src\*.c;
191191
$(LibrariesNativeArtifactsPath)src\*.js;
192192
$(LibrariesNativeArtifactsPath)src\emcc-default.rsp;
193+
$(LibrariesNativeArtifactsPath)src\emcc-link.rsp;
193194
$(LibrariesNativeArtifactsPath)src\emcc-props.json;"
194195
NativeSubDirectory="src"
195196
IsNative="true" />

eng/pipelines/common/platform-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ jobs:
303303
targetRid: browser-wasm
304304
platform: Browser_wasm
305305
container:
306-
image: ubuntu-18.04-webassembly-20210707133424-12f133e
306+
image: ubuntu-18.04-webassembly-20211208134944-544b18c
307307
registry: mcr
308308
jobParameters:
309309
hostedOs: Linux

eng/pipelines/libraries/helix-queues-setup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,6 @@ jobs:
185185

186186
# WebAssembly windows
187187
- ${{ if eq(parameters.platform, 'Browser_wasm_win') }}:
188-
- (Windows.Server.Core.1909.Amd64.Open)windows.10.amd64.server20h2.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-2004-helix-webassembly-amd64-20210702131541-6837048
188+
- (Windows.Server.Core.1909.Amd64.Open)windows.10.amd64.server20h2.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-2004-helix-webassembly-amd64-20211208140215-544b18c
189189

190190
${{ insert }}: ${{ parameters.jobParameters }}

src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@
235235
<PlatformManifestFileEntry Include="pinvoke.c" IsNative="true" />
236236
<PlatformManifestFileEntry Include="pinvoke.h" IsNative="true" />
237237
<PlatformManifestFileEntry Include="emcc-default.rsp" IsNative="true" />
238+
<PlatformManifestFileEntry Include="emcc-link.rsp" IsNative="true" />
238239
<PlatformManifestFileEntry Include="emcc-props.json" IsNative="true" />
239240
<!-- ICU-specific files -->
240241
<PlatformManifestFileEntry Include="libicudata.a" IsNative="true" />

src/mono/mono/component/debugger-agent.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ static gboolean buffer_replies;
414414
DebuggerTlsData *tls; \
415415
tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id);
416416
#else
417-
#define GET_TLS_DATA_FROM_THREAD(thread) \
417+
#define GET_TLS_DATA_FROM_THREAD(...) \
418418
DebuggerTlsData *tls; \
419419
tls = &debugger_wasm_thread;
420420
#define GET_DEBUGGER_TLS() \
@@ -9145,7 +9145,9 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
91459145
int objid;
91469146
ErrorCode err;
91479147
MonoThread *thread_obj;
9148+
#ifndef TARGET_WASM
91489149
MonoInternalThread *thread;
9150+
#endif
91499151
int pos, i, len, frame_idx;
91509152
StackFrame *frame;
91519153
MonoDebugMethodJitInfo *jit;
@@ -9159,11 +9161,16 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
91599161
if (err != ERR_NONE)
91609162
return err;
91619163

9164+
#ifndef TARGET_WASM
91629165
thread = THREAD_TO_INTERNAL (thread_obj);
9163-
9166+
#endif
91649167
id = decode_id (p, &p, end);
91659168

9169+
#ifndef TARGET_WASM
91669170
GET_TLS_DATA_FROM_THREAD (thread);
9171+
#else
9172+
GET_TLS_DATA_FROM_THREAD ();
9173+
#endif
91679174
g_assert (tls);
91689175

91699176
for (i = 0; i < tls->frame_count; ++i) {

src/mono/mono/metadata/seq-points-data.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,10 @@ mono_seq_point_data_read (SeqPointData *data, char *path)
409409
fseek(f, 0, SEEK_SET);
410410

411411
buffer_orig = buffer = (guint8 *)g_malloc (fsize + 1);
412-
fread(buffer_orig, fsize, 1, f);
412+
size_t items = fread(buffer_orig, fsize, 1, f);
413+
if (items != 1)
414+
return FALSE;
415+
413416
fclose(f);
414417

415418
entry_count = decode_var_int (buffer, &buffer);

src/mono/mono/metadata/sre-encode.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ mono_dynimage_encode_typedef_or_ref_full (MonoDynamicImage *assembly, MonoType *
422422
HANDLE_FUNCTION_ENTER ();
423423

424424
MonoDynamicTable *table;
425-
guint32 token, enclosing;
425+
guint32 token;
426426
MonoClass *klass;
427427

428428
/* if the type requires a typespec, we must try that first*/
@@ -446,11 +446,8 @@ mono_dynimage_encode_typedef_or_ref_full (MonoDynamicImage *assembly, MonoType *
446446
goto leave;
447447
}
448448

449-
if (m_class_get_nested_in (klass)) {
450-
enclosing = mono_dynimage_encode_typedef_or_ref_full (assembly, m_class_get_byval_arg (m_class_get_nested_in (klass)), FALSE);
451-
/* get the typeref idx of the enclosing type */
452-
enclosing >>= MONO_TYPEDEFORREF_BITS;
453-
}
449+
if (m_class_get_nested_in (klass))
450+
mono_dynimage_encode_typedef_or_ref_full (assembly, m_class_get_byval_arg (m_class_get_nested_in (klass)), FALSE);
454451
table = &assembly->tables [MONO_TABLE_TYPEREF];
455452
token = MONO_TYPEDEFORREF_TYPEREF | (table->next_idx << MONO_TYPEDEFORREF_BITS); /* typeref */
456453
g_hash_table_insert (assembly->typeref, type, GUINT_TO_POINTER(token));

src/mono/mono/mini/aot-runtime.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,7 +2668,7 @@ compute_llvm_code_range (MonoAotModule *amodule, guint8 **code_start, guint8 **c
26682668

26692669
#ifdef HOST_WASM
26702670
gsize min = 1 << 30, max = 0;
2671-
gsize prev = 0;
2671+
//gsize prev = 0;
26722672

26732673
// FIXME: This depends on emscripten allocating ftnptr ids sequentially
26742674
for (int i = 0; i < amodule->info.nmethods; ++i) {
@@ -2682,7 +2682,7 @@ compute_llvm_code_range (MonoAotModule *amodule, guint8 **code_start, guint8 **c
26822682
min = val;
26832683
else if (val > max)
26842684
max = val;
2685-
prev = val;
2685+
//prev = val;
26862686
}
26872687
}
26882688
if (max) {
@@ -5689,12 +5689,16 @@ get_new_unbox_arbitrary_trampoline_frome_page (gpointer addr)
56895689
static gpointer
56905690
get_numerous_trampoline (MonoAotTrampoline tramp_type, int n_got_slots, MonoAotModule **out_amodule, guint32 *got_offset, guint32 *out_tramp_size)
56915691
{
5692+
#ifndef DISABLE_ASSERT_MESSAGES
56925693
MonoImage *image;
5694+
#endif
56935695
MonoAotModule *amodule = get_mscorlib_aot_module ();
56945696
int index, tramp_size;
56955697

5698+
#ifndef DISABLE_ASSERT_MESSAGES
56965699
/* Currently, we keep all trampolines in the mscorlib AOT image */
56975700
image = mono_defaults.corlib;
5701+
#endif
56985702

56995703
*out_amodule = amodule;
57005704

0 commit comments

Comments
 (0)