This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Andrew Haley writes:
 > Bryce McKinlay writes:
 >  > 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?
 > 
 > It doesn't work for me.  I end up with this:
 > 
 > rwxrwxrwx 1 aph aph       15 Jul 14 14:29 libgcj.so -> libgcj.so.7.0.0*
 > lrwxrwxrwx 1 aph aph       14 Jul 14 14:34 libgcj.so.7 -> libgcj_bc.so.1*
 > -rwxr-xr-x 1 aph aph 83942015 Jul 14 14:29 libgcj.so.7.0.0*
 > 
 > Note that this means 'gij' doesn't work, becasue it's linked against
 > libgcj.so.7, and 'gij' needs gcj::verifyClasses().

Hmm.  Looks like this was a transient problem; I re-installed and it's
OK.

I'll carry on testing.  More later. 

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]