dependency_libs

Jeff Sturm jsturm@one-point.com
Wed Apr 4 16:55:00 GMT 2001


On 4 Apr 2001, Alexandre Oliva wrote:
> If libgcj depends on -lpthread being linked in before -lc, it should
> be linked with -lpthread.

AFAIK that's a pthread requirement, not libgcj.  Symbols like pthread_self
exist in both libc and libpthread, and applications must link to the
correct one...

Besides, libgcj _is_ linked with -lpthread.  It's a matter of getting the
order straight.  Somehow libtool gets it wrong.

> dependency_libs is computed based on the
> libraries a library is linked with, including those that are
> implicitly linked in by the compiler.

OK, thanks.  Here's how it is linked by libtool:

[jsturm@neptune lib]$ ldd libgcj.so
        libpthread.so.0 => /lib/libpthread.so.0 (0x403f6000)
        libdl.so.2 => /lib/libdl.so.2 (0x4040c000)
        libc.so.6 => /lib/libc.so.6 (0x4040f000)
        libgcc_s.so.0 => /opt/gcc/lib/libgcc_s.so.0 (0x40534000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x2aaaa000)

That's fine.  But in libgcj.la we have:

# Libraries that this one depends upon.
dependency_libs=' -L/home/jsturm/gcc-3.0/build/i686-pc-linux-gnu/libjava
-L/home/jsturm/gcc-3.0/build/i686-pc-linux-gnu/libjava/../libstdc++-v3/libsupc++
-L/home/jsturm/gcc-3.0/build/i686-pc-linux-gnu/libstdc++-v3/src
-L/home/jsturm/gcc-3.0/build/i686-pc-linux-gnu/libstdc++-v3/src/.libs -lm
-L/home/jsturm/gcc-3.0/build/gcc
-L/opt/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.0
-L/opt/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.0/../../.. -lc -lgcc_s
-lpthread -ldl  '

Which results in gij linked as follows:

[jsturm@neptune .libs]$ ldd gij
        libgcj.so.1 => /opt/gcc/lib/libgcj.so.1 (0x40018000)
        libm.so.6 => /lib/libm.so.6 (0x4040d000)
        libc.so.6 => /lib/libc.so.6 (0x4042d000)
        libgcc_s.so.0 => /opt/gcc/lib/libgcc_s.so.0 (0x40552000)
        libdl.so.2 => /lib/libdl.so.2 (0x4055b000)
        libgcjgc.so.1 => /opt/gcc/lib/libgcjgc.so.1 (0x4055e000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x4057d000)
        libzgcj.so.0 => /opt/gcc/lib/libzgcj.so.0 (0x40594000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

That's a problem.  Something changed recently to effect this behavior.
For one thing, I'm now getting `build_libtool_need_lc=yes' from ltconfig.

Jeff




More information about the Java mailing list