[wasi] More cross compiler fixes. (#82911)
authorZoltan Varga <vargaz@gmail.com>
Mon, 6 Mar 2023 20:17:12 +0000 (15:17 -0500)
committerGitHub <noreply@github.com>
Mon, 6 Mar 2023 20:17:12 +0000 (14:17 -0600)
src/mono/cmake/config.h.in
src/mono/mono/mini/method-to-ir.c
src/mono/mono/sgen/sgen-conf.h
src/mono/wasi/runtime/driver.c

index d0b5d79ff2097ff79ca5b73a37e0fe3444c893f9..b76584ce4dd3799cd14ab1486d3d106be8e7fa7e 100644 (file)
 /* ... */
 #cmakedefine TARGET_WASM 1
 
+/* ... */
+#cmakedefine TARGET_WASI 1
+
 /* The JIT/AOT targets WatchOS */
 #cmakedefine TARGET_WATCHOS 1
 
index adad6ae20b3b65a98750c04af2e88b77544fada8..af740408fb315b592deb14c7e08cfd04622e1ba6 100644 (file)
@@ -1696,11 +1696,11 @@ MONO_RESTORE_WARNING
 static MonoInst*
 mono_create_fast_tls_getter (MonoCompile *cfg, MonoTlsKey key)
 {
-       int tls_offset = mono_tls_get_tls_offset (key);
-
        if (cfg->compile_aot)
                return NULL;
 
+       int tls_offset = mono_tls_get_tls_offset (key);
+
        if (tls_offset != -1 && mono_arch_have_fast_tls ()) {
                MonoInst *ins;
                MONO_INST_NEW (cfg, ins, OP_TLS_GET);
index 243c3173cd180215eaad07a169eee1e22c642ec6..b0ed17521d9dd17968a25437d0e85621226c8497 100644 (file)
@@ -111,7 +111,7 @@ typedef target_mword SgenDescriptor;
 #endif
 #endif
 
-#if defined (HOST_WASM)
+#if defined (HOST_WASM) || defined(TARGET_WASM)
 #define DEFAULT_MAJOR SGEN_MAJOR_SERIAL
 #define DEFAULT_SWEEP_MODE SGEN_SWEEP_SERIAL
 #elif defined(HAVE_CONC_GC_AS_DEFAULT)
index 94571073ce1a5b07daac76552ad5451b3a0deb28..9c9118c3da478cd810fbbacf2a1e36c91a4728ca 100644 (file)
@@ -104,6 +104,10 @@ typedef uint32_t target_mword;
 typedef target_mword SgenDescriptor;
 typedef SgenDescriptor MonoGCDescriptor;
 
+#ifdef DRIVER_GEN
+#include "driver-gen.c"
+#endif
+
 typedef struct WasmAssembly_ WasmAssembly;
 
 struct WasmAssembly_ {