linking a .so with libgcj.a ?

Andi Vajda
Wed Dec 15 17:32:00 GMT 2004

Yes, stripping works wonders. It's down to 9Mb here.

While this works fine on Linux, it doesn't work on Mac OS X. I stripped
libgcj.5.dylib, the .so is made but upon loading it I get a dyld failure on a 
bunch of libgcj symbols such as __Jv_InitClass, __Jv_AllocObject, etc.. (about 
a dozen). On Mac OS X, a python extension is linked as a bundle.

As for the GDB stack trace, I didn't get any with my default flags, I'm 
building for debugging now, but the GDB stacktrace was ominously short (2 
lines of ???).


On Wed, 15 Dec 2004, Michael Koch wrote:

> Am Mittwoch, 15. Dezember 2004 08:02 schrieb Andi Vajda:
>> On Linux (gentoo 2.6.9), using gcj 3.4.3, built from sources, I'm
>> trying to create a .so (a python extension) that is statically
>> linked with libgcj.a instead of dynamically with
>> I can link it with without a problem, it works fine.
>> If I link it with libgcj.a, it links, creates a .so that crashes
>> with a segfault as soon as it is loaded into the process.
>> On windows, with Mingw 3.4.2, this works (and is the default, there
>> apparently isn't even a libgcj.dll anyway).
>> Linking my .so statically with libgcj.a would reduce the size of
>> the libs I have to ship by a large amount until is
>> installed, standard, on Linux distributions. My .so dynamically
>> linked is 2Mb, statically linked 15Mb, is 41Mb.
> Stripped is 11519264 bytes here.
>> Can I do that ? How ?
> Can you start our app in GDB and give us a backtrace ?
> Michael
> -- 
> Homepage:

More information about the Java mailing list