Skip to content

Commit

Permalink
Fix mingw compilation problems.
Browse files Browse the repository at this point in the history
  • Loading branch information
vargaz committed Aug 8, 2013
1 parent 77f1faf commit ebfd123
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
6 changes: 6 additions & 0 deletions mono/io-layer/io-layer.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@
#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>
Expand Down
Empty file modified mono/metadata/process.c
100644 → 100755
Empty file.
Empty file modified mono/metadata/sgen-os-win32.c
100644 → 100755
Empty file.
8 changes: 5 additions & 3 deletions mono/metadata/threads.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion mono/mini/Makefile.am.in
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions mono/mini/mini-gc.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ebfd123

Please sign in to comment.