[java] RFC/RFA: libgcj_bc.so.1

Bryce McKinlay mckinlay@redhat.com
Fri Jul 14 04:37:00 GMT 2006


Currently, binaries built with GCJ's "Binary Compatibility" ABI link 
against the same SONAME as binaries built with the C++ ABI. This is 
problematic because changes to the Java class libraries frequently break 
C++ ABI compatibility: we need to bump the SONAME with each release, but 
changing the SONAME itself breaks BC-ABI applications which would 
otherwise be compatible. If the two ABIs are to continue to co-exist, we 
need different SONAMEs for them.

This solution works by creating a shared library called libgcj_bc.so 
which contains empty, "fake" declarations of all the symbols that BC-ABI 
applications are allowed to reference in libgcj. At compilation time, if 
-findirect-dispatch is specified, gcj will link with -lgcj_bc instead of 
-lgcj. The linker will find libgcj_bc.so, which has an SONAME of 
libgcj_bc.so.1.

However, libgcj_bc.so.1 itself is actually a symlink to the real 
libgcj.so. So at runtime, the dynamic linker loads the real library to 
resolve the libgcj_bc.so.1 SONAME.

This approach also has the side-benefit of ensuring that BC applications 
only link against legitimate BC-ABI symbols.

Currently this is only enabled for linux systems. It may make sense to 
enable it for other ELF platforms too.

OK for trunk?

Bryce


-------------- next part --------------
A non-text attachment was scrubbed...
Name: java-libgcj_bc.patch
Type: text/x-patch
Size: 12966 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20060714/7dfd6932/attachment.bin>


More information about the Java-patches mailing list