Jeff Sturm
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 => /lib/ (0x403f6000) => /lib/ (0x4040c000) => /lib/ (0x4040f000) => /opt/gcc/lib/ (0x40534000)
        /lib/ => /lib/ (0x2aaaa000)

That's fine.  But in 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/libstdc++-v3/src/.libs -lm
-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 => /opt/gcc/lib/ (0x40018000) => /lib/ (0x4040d000) => /lib/ (0x4042d000) => /opt/gcc/lib/ (0x40552000) => /lib/ (0x4055b000) => /opt/gcc/lib/ (0x4055e000) => /lib/ (0x4057d000) => /opt/gcc/lib/ (0x40594000)
        /lib/ => /lib/ (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.


More information about the Java mailing list