This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [java] RFC/RFA: libgcj_bc.so.1
- From: Andrew Haley <aph at redhat dot com>
- To: Bryce McKinlay <mckinlay at redhat dot com>
- Cc: Java Patches <java-patches at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 14 Jul 2006 14:44:11 +0100
- Subject: Re: [java] RFC/RFA: libgcj_bc.so.1
- References: <44B71F98.9020705@redhat.com>
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().
Andrew.