printing exceptions?

Bryce McKinlay bryce@waitaki.otago.ac.nz
Tue Mar 5 17:12:00 GMT 2002


Tom Tromey wrote:

>>>>>>"Alexandre" == Alexandre Oliva <aoliva@redhat.com> writes:
>>>>>>
>
>Alexandre> Do you have the link commands printed by libtool for both
>Alexandre> alternatives?
>
>Each link line was about 50K by itself.
>I can send them to you if you really want them.
>

I believe its the link command for the "gij" binary itself which is the 
problem, not the linking of libgcj.so.

If I compile gij myself like:

$ gcj gij.cc -I/home/bryce/cvs/gcc/build/i686-pc-linux-gnu/libjava/ 
-I/home/bryce/cvs/gcc/build/i686-pc-linux-gnu/libjava/include -I./include/

then it works fine.

The difference is that libtool passes an explicit "-lgcc_s -lc -lgcc_s" 
to gcj (or c++?) which changes the link order so that libgcc_s is not 
linked first.

ie working hand built gij:

$ ldd ./a.out
        libgcc_s.so.1 => /home/bryce/gcc/lib/libgcc_s.so.1 (0x40018000)
        libgcj.so.2 => /home/bryce/gcc/lib/libgcj.so.2 (0x40020000)
...

broken libtool built gij:

$ ldd `which gij`
        libgcj.so.2 => /home/bryce/gcc31/lib/libgcj.so.2 (0x40018000)
        libdl.so.2 => /lib/libdl.so.2 (0x4057c000)
        libgcjgc.so.1 => /home/bryce/gcc31/lib/libgcjgc.so.1 (0x40580000)
        libzgcj.so.0 => /home/bryce/gcc31/lib/libzgcj.so.0 (0x405ac000)
        libgcc_s.so.1 => /home/bryce/gcc31/lib/libgcc_s.so.1 
(0x405ba000)   <-----  !!!!
...

regards

Bryce.




More information about the Java mailing list