Fix mingw compilation problems.
authorZoltan Varga <vargaz@gmail.com>
Thu, 8 Aug 2013 23:52:02 +0000 (01:52 +0200)
committerZoltan Varga <vargaz@gmail.com>
Thu, 8 Aug 2013 23:59:45 +0000 (01:59 +0200)
mono/io-layer/io-layer.h [changed mode: 0644->0755]
mono/metadata/process.c [changed mode: 0644->0755]
mono/metadata/sgen-os-win32.c [changed mode: 0644->0755]
mono/metadata/threads.c [changed mode: 0644->0755]
mono/mini/Makefile.am.in [changed mode: 0644->0755]
mono/mini/mini-gc.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 014c9a9..394799b
 #include <winsock2.h>
 #include <windows.h>
 #include <winbase.h>
+/*
+ * The mingw version says:
+ * /usr/i686-pc-mingw32/sys-root/mingw/include/ws2tcpip.h:38:2: error: #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."
+ */
+#ifdef _MSC_VER
 #include <ws2tcpip.h>
+#endif
 #include <psapi.h>
 #include <shlobj.h>
 #include <mswsock.h>
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index 2f7e365..8f7f047
@@ -814,10 +814,12 @@ mono_thread_create (MonoDomain *domain, gpointer func, gpointer arg)
 static __inline__ __attribute__((always_inline))
 /* This is not defined by gcc */
 unsigned long long
-__readfsdword (unsigned long long offset)
+__readfsdword (unsigned long offset)
 {
-       unsigned long long value;
-       __asm__("movl %%fs:%a[offset], %k[value]" : [value] "=q" (value) : [offset] "irm" (offset));
+       unsigned long value;
+       //      __asm__("movl %%fs:%a[offset], %k[value]" : [value] "=q" (value) : [offset] "irm" (offset));
+   __asm__ volatile ("movl    %%fs:%1,%0"
+     : "=r" (value) ,"=m" ((*(volatile long *) offset)));
        return value;
 }
 #endif
old mode 100644 (file)
new mode 100755 (executable)
index eb34e4e..926ab52
@@ -117,6 +117,9 @@ noinst_SCRIPTS = mono
 mono: mono-$(mono_bin_suffix)
        ln -sf $< $@
 
+mono.exe: mono-$(mono_bin_suffix).exe
+       ln -sf $< $@
+
 install-exec-hook:
        (cd $(DESTDIR)$(bindir) && ln -sf mono-$(mono_bin_suffix) mono)
        (cd $(DESTDIR)$(libdir); for i in libmono$(libmono_suffix)*; do ln -sf $$i `echo $$i | sed s/$(libmono_suffix)//` ; done)
@@ -236,7 +239,7 @@ MONO_LIB=$(boehm_static_libraries)
 MONO_SGEN_LIB=$(sgen_static_libraries)
 else 
 MONO_LIB=libmonoboehm-2.0.la
-MONO_LIBLIB=libmonosgen-2.0.la
+MONO_SGEN_LIB=libmonosgen-2.0.la
 endif
 
 if LOADED_LLVM
old mode 100644 (file)
new mode 100755 (executable)
index 9088322..ca38406
@@ -598,7 +598,11 @@ thread_suspend_func (gpointer user_data, void *sigctx, MonoContext *ctx)
                gboolean res;
 
                g_assert (tls->info);
+#ifdef TARGET_WIN32
+               return;
+#else
                res = mono_thread_state_init_from_handle (&tls->unwind_state, (MonoNativeThreadId)tls->tid, tls->info->native_handle);
+#endif
        } else {
                tls->unwind_state.unwind_data [MONO_UNWIND_DATA_LMF] = mono_get_lmf ();
                if (sigctx) {