Skip to content

Commit

Permalink
Revert "[wasm] Emscripten 2.0.34 bump (dotnet#62499)"
Browse files Browse the repository at this point in the history
This reverts commit 724c4e1.
  • Loading branch information
radekdoulik committed Feb 17, 2022
1 parent 8c406af commit 5a35c90
Show file tree
Hide file tree
Showing 22 changed files with 88 additions and 94 deletions.
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="7.0.0-preview.3.22115.2">
<Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="7.0.0-preview.2.22081.1">
<Uri>https://github.com/dotnet/icu</Uri>
<Sha>bc6d6740a2b8ba5c2943e1a7a0eaa9781a862050</Sha>
<Sha>4f251e7593b1150af58bba4f461698d6d4a1eb95</Sha>
</Dependency>
<Dependency Name="System.Net.MsQuic.Transport" Version="7.0.0-alpha.1.21529.3">
<Uri>https://github.com/dotnet/msquic</Uri>
<Sha>a7213b4676c1803bb251771291a525482d42e511</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Workload.Emscripten.Manifest-7.0.100" Version="7.0.0-alpha.2.22111.1">
<Dependency Name="Microsoft.NET.Workload.Emscripten.Manifest-7.0.100" Version="7.0.0-alpha.2.22077.1">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>e6541169ee0347b4c3af1b83a0ab9fc19121283c</Sha>
<Sha>b2054b98cb7b9e555cbbe19955df823ec81a93ad</Sha>
</Dependency>
<Dependency Name="System.ServiceModel.Primitives" Version="4.9.0-rc2.21473.1">
<Uri>https://github.com/dotnet/wcf</Uri>
Expand Down
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
<MicrosoftNETILLinkTasksVersion>7.0.100-1.22107.1</MicrosoftNETILLinkTasksVersion>
<MicrosoftNETILLinkAnalyzerPackageVersion>$(MicrosoftNETILLinkTasksVersion)</MicrosoftNETILLinkAnalyzerPackageVersion>
<!-- ICU -->
<MicrosoftNETCoreRuntimeICUTransportVersion>7.0.0-preview.3.22115.2</MicrosoftNETCoreRuntimeICUTransportVersion>
<MicrosoftNETCoreRuntimeICUTransportVersion>7.0.0-preview.2.22081.1</MicrosoftNETCoreRuntimeICUTransportVersion>
<!-- MsQuic -->
<SystemNetMsQuicTransportVersion>7.0.0-alpha.1.21529.3</SystemNetMsQuicTransportVersion>
<!-- Mono LLVM -->
Expand All @@ -197,7 +197,7 @@
<runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>11.1.0-alpha.1.22114.2</runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>
<runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>11.1.0-alpha.1.22114.2</runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>
<!-- emscripten / Node -->
<MicrosoftNETWorkloadEmscriptenManifest70100Version>7.0.0-alpha.2.22111.1</MicrosoftNETWorkloadEmscriptenManifest70100Version>
<MicrosoftNETWorkloadEmscriptenManifest70100Version>7.0.0-alpha.2.22077.1</MicrosoftNETWorkloadEmscriptenManifest70100Version>
<MicrosoftNETRuntimeEmscriptenVersion>$(MicrosoftNETWorkloadEmscriptenManifest70100Version)</MicrosoftNETRuntimeEmscriptenVersion>
<!-- workloads -->
<SwixPackageVersion>1.1.87-gba258badda</SwixPackageVersion>
Expand Down
1 change: 0 additions & 1 deletion eng/liveBuilds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@
$(LibrariesNativeArtifactsPath)src\*.c;
$(LibrariesNativeArtifactsPath)src\*.js;
$(LibrariesNativeArtifactsPath)src\emcc-default.rsp;
$(LibrariesNativeArtifactsPath)src\emcc-link.rsp;
$(LibrariesNativeArtifactsPath)src\emcc-props.json;"
NativeSubDirectory="src"
IsNative="true" />
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/common/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ jobs:
targetRid: browser-wasm
platform: Browser_wasm
container:
image: ubuntu-18.04-webassembly-20211208134944-544b18c
image: ubuntu-18.04-webassembly-20210707133424-12f133e
registry: mcr
jobParameters:
hostedOs: Linux
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 @@ -182,6 +182,6 @@ jobs:

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

${{ insert }}: ${{ parameters.jobParameters }}
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@
<PlatformManifestFileEntry Include="pinvoke.c" IsNative="true" />
<PlatformManifestFileEntry Include="pinvoke.h" IsNative="true" />
<PlatformManifestFileEntry Include="emcc-default.rsp" IsNative="true" />
<PlatformManifestFileEntry Include="emcc-link.rsp" IsNative="true" />
<PlatformManifestFileEntry Include="emcc-props.json" IsNative="true" />
<!-- ICU-specific files -->
<PlatformManifestFileEntry Include="libicudata.a" IsNative="true" />
Expand Down
11 changes: 2 additions & 9 deletions src/mono/mono/component/debugger-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ static gboolean buffer_replies;
DebuggerTlsData *tls; \
tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id);
#else
#define GET_TLS_DATA_FROM_THREAD(...) \
#define GET_TLS_DATA_FROM_THREAD(thread) \
DebuggerTlsData *tls; \
tls = &debugger_wasm_thread;
#define GET_DEBUGGER_TLS() \
Expand Down Expand Up @@ -9145,9 +9145,7 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
int objid;
ErrorCode err;
MonoThread *thread_obj;
#ifndef TARGET_WASM
MonoInternalThread *thread;
#endif
int pos, i, len, frame_idx;
StackFrame *frame;
MonoDebugMethodJitInfo *jit;
Expand All @@ -9161,16 +9159,11 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
if (err != ERR_NONE)
return err;

#ifndef TARGET_WASM
thread = THREAD_TO_INTERNAL (thread_obj);
#endif

id = decode_id (p, &p, end);

#ifndef TARGET_WASM
GET_TLS_DATA_FROM_THREAD (thread);
#else
GET_TLS_DATA_FROM_THREAD ();
#endif
g_assert (tls);

for (i = 0; i < tls->frame_count; ++i) {
Expand Down
8 changes: 1 addition & 7 deletions src/mono/mono/metadata/seq-points-data.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,7 @@ mono_seq_point_data_read (SeqPointData *data, char *path)
fseek(f, 0, SEEK_SET);

buffer_orig = buffer = (guint8 *)g_malloc (fsize + 1);
size_t len = fread(buffer_orig, fsize, 1, f);
if (ferror(f)) {
fclose(f);
return FALSE;
}
g_assert (len == fsize || (len < fsize && feof(f)));

fread(buffer_orig, fsize, 1, f);
fclose(f);

entry_count = decode_var_int (buffer, &buffer);
Expand Down
9 changes: 6 additions & 3 deletions src/mono/mono/metadata/sre-encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ mono_dynimage_encode_typedef_or_ref_full (MonoDynamicImage *assembly, MonoType *
HANDLE_FUNCTION_ENTER ();

MonoDynamicTable *table;
guint32 token;
guint32 token, enclosing;
MonoClass *klass;

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

if (m_class_get_nested_in (klass))
mono_dynimage_encode_typedef_or_ref_full (assembly, m_class_get_byval_arg (m_class_get_nested_in (klass)), FALSE);
if (m_class_get_nested_in (klass)) {
enclosing = mono_dynimage_encode_typedef_or_ref_full (assembly, m_class_get_byval_arg (m_class_get_nested_in (klass)), FALSE);
/* get the typeref idx of the enclosing type */
enclosing >>= MONO_TYPEDEFORREF_BITS;
}
table = &assembly->tables [MONO_TABLE_TYPEREF];
token = MONO_TYPEDEFORREF_TYPEREF | (table->next_idx << MONO_TYPEDEFORREF_BITS); /* typeref */
g_hash_table_insert (assembly->typeref, type, GUINT_TO_POINTER(token));
Expand Down
8 changes: 2 additions & 6 deletions src/mono/mono/mini/aot-runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -2668,7 +2668,7 @@ compute_llvm_code_range (MonoAotModule *amodule, guint8 **code_start, guint8 **c

#ifdef HOST_WASM
gsize min = 1 << 30, max = 0;
//gsize prev = 0;
gsize prev = 0;

// FIXME: This depends on emscripten allocating ftnptr ids sequentially
for (int i = 0; i < amodule->info.nmethods; ++i) {
Expand All @@ -2682,7 +2682,7 @@ compute_llvm_code_range (MonoAotModule *amodule, guint8 **code_start, guint8 **c
min = val;
else if (val > max)
max = val;
//prev = val;
prev = val;
}
}
if (max) {
Expand Down Expand Up @@ -5689,16 +5689,12 @@ get_new_unbox_arbitrary_trampoline_frome_page (gpointer addr)
static gpointer
get_numerous_trampoline (MonoAotTrampoline tramp_type, int n_got_slots, MonoAotModule **out_amodule, guint32 *got_offset, guint32 *out_tramp_size)
{
#ifndef DISABLE_ASSERT_MESSAGES
MonoImage *image;
#endif
MonoAotModule *amodule = get_mscorlib_aot_module ();
int index, tramp_size;

#ifndef DISABLE_ASSERT_MESSAGES
/* Currently, we keep all trampolines in the mscorlib AOT image */
image = mono_defaults.corlib;
#endif

*out_amodule = amodule;

Expand Down
11 changes: 2 additions & 9 deletions src/mono/mono/mini/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2067,12 +2067,9 @@ mono_main (int argc, char* argv[])
MonoDomain *domain;
MonoImageOpenStatus open_status;
const char* aname, *mname = NULL;
int i;
#ifndef DISABLE_JIT
int count = 1;
MonoGraphOptions mono_graph_options = (MonoGraphOptions)0;
#endif
int i, count = 1;
guint32 opt, action = DO_EXEC, recompilation_times = 1;
MonoGraphOptions mono_graph_options = (MonoGraphOptions)0;
int mini_verbose_level = 0;
char *trace_options = NULL;
char *aot_options = NULL;
Expand Down Expand Up @@ -2225,15 +2222,13 @@ mono_main (int argc, char* argv[])
} else if (strcmp (argv [i], "--mixed-mode") == 0) {
mixed_mode = TRUE;
#endif
#ifndef DISABLE_JIT
} else if (strcmp (argv [i], "--ncompile") == 0) {
if (i + 1 >= argc){
fprintf (stderr, "error: --ncompile requires an argument\n");
return 1;
}
count = atoi (argv [++i]);
action = DO_BENCH;
#endif
} else if (strcmp (argv [i], "--trace") == 0) {
trace_options = (char*)"";
} else if (strncmp (argv [i], "--trace=", 8) == 0) {
Expand Down Expand Up @@ -2351,7 +2346,6 @@ mono_main (int argc, char* argv[])

mname = argv [++i];
action = DO_BENCH;
#ifndef DISABLE_JIT
} else if (strncmp (argv [i], "--graph=", 8) == 0) {
if (i + 1 >= argc){
fprintf (stderr, "error: --graph option requires a method name argument\n");
Expand All @@ -2370,7 +2364,6 @@ mono_main (int argc, char* argv[])
mname = argv [++i];
mono_graph_options = MONO_GRAPH_CFG;
action = DO_DRAW;
#endif
} else if (strcmp (argv [i], "--debug") == 0) {
enable_debugging = TRUE;
} else if (strncmp (argv [i], "--debug=", 8) == 0) {
Expand Down
4 changes: 0 additions & 4 deletions src/mono/mono/mini/mini-generic-sharing.c
Original file line number Diff line number Diff line change
Expand Up @@ -1739,9 +1739,7 @@ mini_get_interp_in_wrapper (MonoMethodSignature *sig)
static GHashTable *cache;
const char *name;
gboolean generic = FALSE;
#ifndef DISABLE_JIT
gboolean return_native_struct;
#endif

sig = mini_get_underlying_reg_signature (sig);

Expand All @@ -1765,9 +1763,7 @@ mini_get_interp_in_wrapper (MonoMethodSignature *sig)
* stack, pass this address to the interp_entry and when we return it we use
* CEE_MONO_LDNATIVEOBJ
*/
#ifndef DISABLE_JIT
return_native_struct = sig->ret->type == MONO_TYPE_VALUETYPE && sig->pinvoke && !sig->marshalling_disabled;
#endif

/* Create the signature for the wrapper */
csig = g_malloc0 (MONO_SIZEOF_METHOD_SIGNATURE + (sig->param_count * sizeof (MonoType*)));
Expand Down
8 changes: 4 additions & 4 deletions src/mono/mono/mini/mini-runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -3285,7 +3285,7 @@ mono_llvmonly_runtime_invoke (MonoMethod *method, RuntimeInvokeInfo *info, void
static MonoObject*
mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error)
{
MonoMethod *callee;
MonoMethod *invoke, *callee;
MonoObject *(*runtime_invoke) (MonoObject *this_obj, void **params, MonoObject **exc, void* compiled_method);
RuntimeInvokeInfo *info, *info2;
MonoJitInfo *ji = NULL;
Expand Down Expand Up @@ -3328,7 +3328,7 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec
MonoMethod *wrapper;

wrapper = mono_marshal_get_array_accessor_wrapper (method);
mono_marshal_get_runtime_invoke (wrapper, FALSE);
invoke = mono_marshal_get_runtime_invoke (wrapper, FALSE);
callee = wrapper;
} else {
callee = NULL;
Expand Down Expand Up @@ -3404,8 +3404,8 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec
static RuntimeInvokeDynamicFunction dyn_runtime_invoke = NULL;
if (info->dyn_call_info) {
if (!dyn_runtime_invoke) {
MonoMethod *dynamic_invoke = mono_marshal_get_runtime_invoke_dynamic ();
RuntimeInvokeDynamicFunction invoke_func = (RuntimeInvokeDynamicFunction)mono_jit_compile_method_jit_only (dynamic_invoke, error);
invoke = mono_marshal_get_runtime_invoke_dynamic ();
RuntimeInvokeDynamicFunction invoke_func = (RuntimeInvokeDynamicFunction)mono_jit_compile_method_jit_only (invoke, error);
mono_memory_barrier ();
dyn_runtime_invoke = invoke_func;
if (!dyn_runtime_invoke && mono_use_interpreter) {
Expand Down
40 changes: 39 additions & 1 deletion src/mono/mono/mini/mini-wasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ mono_arch_create_vars (MonoCompile *cfg)
{
MonoMethodSignature *sig;
CallInfo *cinfo;
MonoType *sig_ret;

sig = mono_method_signature_internal (cfg->method);

Expand All @@ -219,7 +220,7 @@ mono_arch_create_vars (MonoCompile *cfg)
// if (cinfo->ret.storage == ArgValuetypeInReg)
// cfg->ret_var_is_local = TRUE;

mini_get_underlying_type (sig->ret);
sig_ret = mini_get_underlying_type (sig->ret);
if (cinfo->ret.storage == ArgValuetypeAddrInIReg || cinfo->ret.storage == ArgGsharedVTOnStack) {
cfg->vret_addr = mono_compile_create_var (cfg, mono_get_int_type (), OP_ARG);
if (G_UNLIKELY (cfg->verbose_level > 1)) {
Expand Down Expand Up @@ -646,6 +647,8 @@ 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 @@ -675,6 +678,13 @@ 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 @@ -688,6 +698,18 @@ 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 @@ -725,6 +747,22 @@ 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
1 change: 0 additions & 1 deletion src/mono/mono/sgen/sgen-gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,6 @@ sgen_dummy_use (gpointer v)
{
#if defined(_MSC_VER) || defined(HOST_WASM)
static volatile gpointer ptr;
(void)ptr; // avoid compiler warning: variable 'ptr' set but not used
ptr = v;
#elif defined(__GNUC__)
__asm__ volatile ("" : "=r"(v) : "r"(v));
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/sgen/sgen-workers.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void sgen_workers_set_num_active_workers (int generation, int num_workers);
#ifndef DISABLE_SGEN_MAJOR_MARKSWEEP_CONC
void sgen_workers_start_all_workers (int generation, SgenObjectOperations *object_ops_nopar, SgenObjectOperations *object_ops_par, SgenWorkersFinishCallback finish_job);
#else
#define sgen_workers_start_all_workers(generation, object_ops_nopar, object_ops_par, finish_job) (void)object_ops_par; // avoid compiler warning: variable 'object_ops_par' set but not used
#define sgen_workers_start_all_workers(...)
#endif

void sgen_workers_enqueue_job (int generation, SgenThreadPoolJob *job, gboolean enqueue);
Expand Down
Loading

0 comments on commit 5a35c90

Please sign in to comment.