Re[2]: [GC] Missing references when building under MinGW

Ivan Maidanski ivmai at mail.ru
Sat Feb 25 03:11:17 PST 2012


Hi Sergio,

25 02 2012, 12:32 Sergio NNX <sfhacker at hotmail.com>:
> 
> > There has been a number of changes in configure and win32_threads.c
>  since 7.2alpha6. Please fetch more fresh code (using git as explained
> below) and let me know whether the problem still exists.
> 
> Ciao Ivan.
> 
> Thanks for your reply.
> 
> I have fetched the lastest code from Git but the problem still persists! This is what I've tried so far:
> 
> a) ./configure --prefix=/mingw --enable-static --enable-shared --enable-cplusplus --enable-threads=win32
> 
>     make

BDWGC supports 2 threading models - posix (pthreads) and win32.
For Windows (excluding Cygwin) the default is win32 (i.e. BDWGC uses Win32 API for synchronization and intercepts CreateThread invoked by client).
Alternatively, you could build BDWGC which uses pthreads-w32 lib (by specifying --enable-threads=pthreads or -D GC_WIN32_PTHREADS) - this is recommended only if the client relies on pthreads-w32 too.

Cygwin port of BDWGC uses mostly pthreads API and intercepts pthread_create() invoked by client (but could also intercept Win32 CreateThread starting from GC v7.3).

> 
>     It builds ok, but libgc.a doesn't contain the symbols guile (among others) app needs in order to be built

Which symbols?

> 
> b) ./configure --prefix=/mingw --enable-static --enable-shared --enable-cplusplus --enable-threads=pthreads
> 
>     make
> 
>     This option doesn't work: 'make' complains about 'SIGRTMIN undeclared' (misc.c line 462)
>     I fixed that but then i get hundreds of 'undefined references' (e.g. GC_lock, GC_need_to_lock, GC_allocate_lock, GC_allocate_ml, GC_push_thread_structures, etc) in several files.

Probably, you fixed it in the wrong way.
I've committed my fix.

Please pull the sources again and retry.

> 
> By digging into the source code a little bit, I noticed that, in some files, there's an '#if' condicion like:
> 
>                          #if defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS)
> 
> So, what's the logic behind it? When is GC_PTHREADS defined? Is it either GC_PTHREADS or GC_WIN32_THREADS?

GC_PTHREADS instructs BDWGC to use pthreads API.
GC_WIN32_THREADS signals that our target is Win32 (including Win64, WinCE, Cygwin, win32-pthreads).
GC_WIN32_PTHREADS instructs BDWGC to use pthreads-w32 library.

So the above #if condition could be written as defined(THREADS) && !defined(GC_WIN32_THREADS) (since only 2 threading models are supported).

> 
> I'm more than happy to contribute to this project (e.g. testing, patched, etc) but i may need some help from GC developers. Just let me know how I can help.

Good. There are 2 versions of BDWGC available in Git repo - 7.3alpha1 (development) in "master" branch and 7.2alpha7 (release candidate) in "release" branch. I've commit any bugfix to both branches. But I don't have access to that many targets supported so you help is really appreciated!

Regards.

> 
> Thanks in advance.
> 
> Sergio.
>  		 	   		
> 



More information about the Gc mailing list