Re: [Gc]: Mingw Compile Issues
ivmai at mail.ru
Sun Oct 25 06:46:55 PST 2009
Thomas Lien <tgunlien at yahoo.com> wrote:
> Hello. I'm am running on Windows XP using the latest MinGW GCC compiler and also MSYS command line utilities. When trying to build the boehm gc libary I first ran "sh configure" and that went fine. Then I ran "make" but I have a problem at the link stage with lots of messages like "gc-7.1/alloc.c:474: undefined reference to `GC_stop_world'.
Similar recent topic: https://permalink.gmane.org/gmane.comp.programming.garbage-collection.boehmgc/3280
> Has anyone tried compiling using MinGW? I am attaching the output of both configure and make (make.txt has the errors at the bottom) in hopes that someone has an idea about why the linking is failing. Thanks in advance.
This should be uninterested to me since too many changes have been been done since gc7.1 release (but I'll look it thru).
> > gcc --version
> gcc.exe (GCC) 3.4.5 (mingw-vista special r3)
1. Don't try to compile gc7.1 with MinGW.
2. Get latest CVS snapshot from bdwgc.sf.net (you can aso try to compile surces from gc72alpha2 tarball but it contains a number of Win32-specific bugs fixed later).
3. Unfortunately, AFAIK, at present there's no working building script for MinGW (but you can try to "sh configure" and contribute the fixes, if any), so the most "reliable" and tested way is to invoke gcc manually, e.g. something like this builds a release gc.dll and test.exe:
gcc -O2 -fno-strict-aliasing -Wall -DALL_INTERIOR_POINTERS -DJAVA_FINALIZATION -DGC_GCJ_SUPPORT -DATOMIC_UNCOLLECTABLE -DNO_DEBUGGING -DLARGE_CONFIG -DUSE_MUNMAP -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK -I.\include -I.\libatomic_ops\src -DGC_DLL -shared -o gc.dll -s -luser32 extra/gc.c
gcc -O2 -fno-strict-aliasing -Wall -DALL_INTERIOR_POINTERS -DJAVA_FINALIZATION -DGC_GCJ_SUPPORT -DATOMIC_UNCOLLECTABLE -DNO_DEBUGGING -DLARGE_CONFIG -DUSE_MUNMAP -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK -I.\include -I.\libatomic_ops\src -DGC_DLL -s -o test.exe tests/test.c gc.dll
4. Tested with the following GCC toolchains for Windows (x86 and amd64):
- MinGW v5.1.4 (GCC v4.4.0, mingwrt-3.15.2, w32api-3.13, binutils-2.19.1);
- mingw-w64(w32) i686-w64-mingw32-gcc.exe (GCC) 4.5.0 20091013 (experimental);
- mingw-w64 x86_64-w64-mingw32-gcc.exe (GCC) 4.5.0 20091014 (experimental).
Any more questions?
More information about the Gc