Re: [Gc] Newbie questions

Ivan Maidanski ivmai at
Thu Sep 24 08:05:46 PDT 2009


Lloyd Sargent <lloyd at> wrote:
> Hey folks, 30 year veteran here and the documentation is so confusing.
21, to be correct ;)

I agree, the docs are not perfect (and outdated in some places).

> 1) First, what IS the license for GC for Windows and Linux? MIT, BSD,  
> or GPL? If it is GPL I can't use it.

The license is in doc/Readme. (Might be, it should be updated... Hans knows better...)

> 2) Assuming that the license is unrestrictive, can you build GC for  
> Ming on 32 bit machine? If so, what is the recommended procedure. It  
> is alluded to, but never explained.

Yes, both MinGW and mingw-w64 (32/64-bit) are supported.

> 3) Trying to build 7.1 with Mingw and I get:

It's better to use v7.2alpha2 (or, even, fetch the CVS version).

> /bin/sh ./libtool --tag=CC --mode=link gcc -fexceptions -I  
> ...
> .libs/alloc.o: In function `GC_stopped_mark':
> C:/msys/1.0/home/lloyd/gc/alloc.c:474: undefined reference to  
> `_GC_stop_world'
> C:/msys/1.0/home/lloyd/gc/alloc.c:501: undefined reference to  
> `_GC_start_world'
> C:/msys/1.0/home/lloyd/gc/alloc.c:525: undefined reference to  
> `_GC_start_world'
> .libs/alloc.o: In function `GC_collect_a_little':
> (etc, etc)
> 4) This was configured with the following:
>   ./configure --enable-cplusplus --enable-threads=win32
> using MSYS

"configure" is outdated and needs to be regenerated from works for Cygwin, but I don't know whether it's working for MSYS.

"Makefile" doesn't work for mingw too...

> If this is NOT the correct way of doing things, would you please  
> elucidate?

For now, I'd recommend you the following steps:
- fetch today's CVS;
- enter "bdwgc" dir;
- type: gcc -fno-strict-aliasing -Wall -DALL_INTERIOR_POINTERS -DUSE_MUNMAP -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK -O2 -DNO_DEBUGGING -DNDEBUG -I.\include -I.\libatomic_ops-1.2\src -c *.c *.cpp
- type: ar crus libgc.a *.o

If you need a debug version, replace "-O2 -DNO_DEBUGGING -DNDEBUG" with "-g -DGC_ASSERTIONS".
If you don't need a multi-threaded lib, remove "-DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK -I.\libatomic_ops-1.2\src".

A bit complicated for a beginner, but are there volunteers to update the docs and build scripts?

> Cheers,
> Lloyd


More information about the Gc mailing list