[Gc] GC_INIT on solaris

Boehm, Hans hans.boehm at hp.com
Tue Mar 7 16:33:26 PST 2006


Hopefully this was fixed in 6.7.  If not, could you let me know?

I unfortunately did not get a chance to test on Solaris, but this sounds
like an old problem.

Hans 

> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com 
> [mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of John Plevyak
> Sent: Thursday, February 23, 2006 9:15 AM
> To: gc at napali.hpl.hp.com
> Subject: [Gc] GC_INIT on solaris
> 
> 
> 
> We've been using BoehmGC 6.5 without issue on our Linux 
> platforms, but are having trouble on our Sun platforms.  The 
> output of uname -a is as
> follows:
> 
>        SunOS stemp6.wc.cray.com 5.9 Generic_118558-05 sun4u 
> sparc SUNW,Ultra-60
> 
> and the version of g++ that I'm using is 3.4.3.
> 
> 
> 
> In particular, the following simple program results in compilation
> problems:
> 
> 
> testgc.cpp
> ------------------------------------
> #include "gc_cpp.h"
> 
> int main(int argc, char* argv[]) {
>   GC_INIT();
> }
> ------------------------------------
> 
> 
> g++ -Wall -c -I ../third-party/boehmgc/gc6.5/include/ testgc.cpp
> testgc.cpp: In function `int main(int, char**)':
> testgc.cpp:5: error: ISO C++ forbids declaration of `end' with no type
> testgc.cpp:5: error: ISO C++ forbids declaration of `etext' 
> with no type
> testgc.cpp:5: error: `GC_noop' undeclared (first use this function)
> testgc.cpp:5: error: (Each undeclared identifier is reported 
> only once for each function it appears in.)
> 
> 
> 
> If I just declare "end" and "etext" to be of type "int" (just 
> to see if there are other issues).  This leads to the next error:
> 
> testgc.cpp: In function `int main(int, char**)':
> testgc.cpp:5: error: `GC_noop' undeclared (first use this function)
> testgc.cpp:5: error: (Each undeclared identifier is reported 
> only once for each function it appears in.)
> 
> 
> Here, by compiling mark.c using -E, I found that the 
> 0-argument version of
> GC_noop() is being used.  However, prototyping this version 
> of the function within the gc.h header is problematic because 
> the prototype is expecting 0 arguments and we're sending in 2 
> for the Sun version of GC_INIT().  Meanwhile, prototyping the 
> varargs version results in problems when building the BoehmGC 
> library because it mismatches the prototype in gc_priv.h.
> 
> 
> We have hacked it (clearly not the 'right thing'):
> 
> 943,944c943,950
> < #   define GC_INIT() { extern end, etext; \
> <                      GC_noop(&end, &etext); }
> ---
> > # ifdef __cplusplus
> >       extern "C" {
> > # endif
> >         GC_API void GC_noop();
> > # ifdef __cplusplus
> >       }
> > # endif
> > #   define GC_INIT() { GC_noop(); }
> 
> 
> If anyone has any insight, I would greatly appreciate 
> anything you have to offer.
> 
> Thanks very much,
> John Plevyak (for my co-worker Brad Chamberlain)
> -- 
> John Bradley Plevyak, PhD,   jplevyak at acm.org,   PGP KeyID: 051130BD
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
> 



More information about the Gc mailing list