[Gc] Problems on mac and alpha/linux

Stephane Epardaud Stephane.Epardaud at sophia.inria.fr
Thu Jun 30 03:08:35 PDT 2005


I'm trying to compile the gc 7.0a3 on MacOSX and Alpha/Linux, and I'm having

On MacOSX:

On Darwin, mach_dep.lo is built, and there is this code in there:

#if defined(HAVE_PUSH_REGS) && defined(THREADS)
# error GC_push_regs cannot be used with threads

However, I want to use PThreads, so THREADS is defined, and on Darwin,
USE_ASM_PUSH_REGS is defined, resulting in HAVE_PUSH_REGS defined too
(mach_dep.c#79). So I get a cpp error and I cannot compile. But since there's
code underneath the #error, should I assume it's a #warning and change it so ?

On Alpha/Linux:

In configure.ac the file mach_dep.lo is added to $addobjs only if there's
nothing in $machdep. Under i386/Linux this works, but here, GC_push_regs is
defined in alpha_mach_dep.S so $machdep has that and is not empty. The problem
is that in mach_dep.c, GC_with_callee_saves_pushed is defined (via GC_push_regs)
and this function is used in pthread_(support|stop_world).c. Thus I cannot link
libgc.la without mach_dep.lo, and thus I cannot build on Alpha/Linux.
I'm not sure what the correct behaviour is, so I'm not proposing a patch, as
many *_dep.S define only GC_push_regs, and thus if pthread_support.c is to use
GC_with_callee_saves_pushed, mach_dep.c would have to be included for
practically all architectures, and I'm not sure it's the right solution. Or not
use GC_with_callee_saves_pushed in pthread_support.c ?

More information about the Gc mailing list