Bugzilla – Bug 313471
Compile libgc in mono cvs tree failed (cygwin)
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by liyul@hotmail.com 2003-12-24 14:23:51 MST ---- Should merge fix in http://gcc.gnu.org/ml/gcc-patches/2003-07/msg02692.html 2003-07-29 Danny Smith <dannysmith@users.sourceforge.net> * include/gc.h (GC_CreateThread): Declare with WINAPI attribute. * win32_threads.c (GC_CreateThread): Make definitions consistent with declaration. Cast &thread_table[i].handle to PHANDLE in call to DuplicateHandle (thread_start): Declare as static. Index: win32_threads.c =================================================================== RCS file: /cvs/gcc/gcc/boehm-gc/win32_threads.c,v retrieving revision 1.14 diff -c -3 -p -r1.14 win32_threads.c *** win32_threads.c 28 Jul 2003 04:18:21 -0000 1.14 --- win32_threads.c 29 Jul 2003 08:49:33 -0000 *************** void GC_get_next_stack(char *start, char *** 376,382 **** /* We register threads from DllMain */ ! GC_API HANDLE GC_CreateThread( LPSECURITY_ATTRIBUTES lpThreadAttributes, DWORD dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId ) --- 376,382 ---- /* We register threads from DllMain */ ! GC_API HANDLE WINAPI GC_CreateThread( LPSECURITY_ATTRIBUTES lpThreadAttributes, DWORD dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId ) *************** typedef struct { *** 397,405 **** LPVOID param; } thread_args; ! DWORD WINAPI thread_start(LPVOID arg); ! HANDLE WINAPI GC_CreateThread( LPSECURITY_ATTRIBUTES lpThreadAttributes, DWORD dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId ) --- 397,405 ---- LPVOID param; } thread_args; ! static DWORD WINAPI thread_start(LPVOID arg); ! GC_API HANDLE WINAPI GC_CreateThread( LPSECURITY_ATTRIBUTES lpThreadAttributes, DWORD dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId ) *************** HANDLE WINAPI GC_CreateThread( *** 445,451 **** if (!DuplicateHandle(GetCurrentProcess(), thread_h, GetCurrentProcess(), ! &thread_table[i].handle, 0, 0, DUPLICATE_SAME_ACCESS)) { --- 445,451 ---- if (!DuplicateHandle(GetCurrentProcess(), thread_h, GetCurrentProcess(), ! (PHANDLE) &thread_table[i].handle, 0, 0, DUPLICATE_SAME_ACCESS)) { Index: include/gc.h =================================================================== RCS file: /cvs/gcc/gcc/boehm-gc/include/gc.h,v retrieving revision 1.10 diff -c -3 -p -r1.10 gc.h *** include/gc.h 28 Jul 2003 04:18:22 -0000 1.10 --- include/gc.h 29 Jul 2003 08:49:36 -0000 *************** extern void GC_thr_init(); /* Needed for *** 895,901 **** * and does then use DllMain to keep track of thread creations. But new code * should be built to call GC_CreateThread. */ ! GC_API HANDLE GC_CreateThread( LPSECURITY_ATTRIBUTES lpThreadAttributes, DWORD dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId ); --- 895,901 ---- * and does then use DllMain to keep track of thread creations. But new code * should be built to call GC_CreateThread. */ ! GC_API HANDLE WINAPI GC_CreateThread( LPSECURITY_ATTRIBUTES lpThreadAttributes, DWORD dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId ); ---- Additional Comments From liyul@hotmail.com 2003-12-24 14:32:41 MST ---- BTW, the generated Makefile doesn't have necessary -mon-cygwin flag. Which also needs to be fixed in ./config script. ---- Additional Comments From liyul@hotmail.com 2003-12-24 15:06:41 MST ---- It could save people a lot of efforts if build mono.exe and gc.dll out of cvs flawlessly. We tweaked it, managed to build it, just to find it crashes and doesn't dynamically link with gc.dll. So we are even farther away from putting jit into dll for easier embedding. No wonder windows installer for 0.29 lag so far behind linux cousins. ---- Additional Comments From liyul@hotmail.com 2004-02-01 19:34:53 MST ---- The 1/14/04 snapshot have the mono-build-w32.sh fixed. It was later broken again. Since I can already compile mono-0.28 or mono-20040114 after playing more with mono and with the help of new script. It can be closed. Keeping mono easy to build for "outsider" is essential, though. Unknown operating system unknown. Setting to default OS "Other".