This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [PATCH] Don't link ecj1 against libgcj.so.* (PR libgcj/38396, take 2)
Jakub Jelinek wrote:
> On Thu, Dec 18, 2008 at 06:05:40PM +0100, Paolo Bonzini wrote:
>>> But when we are already touching this...
>>> It is true that for !ENABLE_SHARED USE_LIBGCJ_BC doesn't make any sense.
>>> Perhaps we should disable USE_LIBGCJ_BC if !ENABLE_SHARED during configury.
>>>
>>> Still, I guess we should avoid -lgcj_bc for -static, so perhaps
>>> if "$enable_shared" != yes; then
>>> use_libgcj_bc=no
>>> fi
>> This could go in configure.host too:
>>
>> case "${host}" in
>> *linux*|*-kfreebsd*-gnu|*-gnu*)
>> - use_libgcj_bc=yes
>> + use_libgcj_bc=$enable_shared
>> ;;
>> *)
>> use_libgcj_bc=no
>> ;;
>> esac
>
> It can't, because configure.host is sourced before enable_shared
> is tweaked.
>
>>> if test "$use_libgcj_bc" = yes; then
>>> LIBGCJ_SPEC="%{s-bc-abi:%{static:-lgcj;:-lgcj_bc};:-lgcj}"
>>> fi
>> And I agree on this too. If it fixes the bug, it would indeed be a
>> better fix.
>
> Without the patch (with DESTDIR=/tmp/libjava_test installed gcj):
> $ /tmp/libjava_test/usr/local/bin/gcj -o HelloWorld HelloWorld.java -fmain=HelloWorld -findirect-dispatch -static
> $ ./HelloWorld
> libgcj error: This is libgcj_bc.so, a fake library used only for linking.
> Please create a symlink from libgcj_bc.so.1 to the real libgcj.so.
> $ /tmp/libjava_test/usr/local/bin/gcj -o HelloWorld HelloWorld.java -fmain=HelloWorld -findirect-dispatch -static-libgcj
> $ ./HelloWorld
> libgcj error: This is libgcj_bc.so, a fake library used only for linking.
> Please create a symlink from libgcj_bc.so.1 to the real libgcj.so.
>
> Here is an updated patch that handles this as well.
>
> Ok for trunk/4.3?
Yes, thanks.
Andrew.