This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: libtool, java woes


>>>>> "Alexandre" == Alexandre Oliva <aoliva@redhat.com> writes:

Alexandre> Yep.  libsupc++ is linked with -lc.  Since libsupc++
Alexandre> appears before -lpthread in the libgcj link command line,
Alexandre> -lc gets linked in first.  The solution is to move
Alexandre> -lpthread first, or get libsupc++ linked with -lpthread.
Alexandre> The former is probably best for libgcj.

The problems I'm seeing have nothing to do with -lpthread but instead
the relative ordering of -lc and -lgcc_s.  If -lc comes first, then my
Java programs crash on exit.  If -lgcc_s comes first, then they work.

For some reason libtool is deciding -lc must come first.  This is what
ends up in libgcj.la:

dependency_libs=' -L/x1/gcc3/build/i686-pc-linux-gnu/libjava -L/x1/gcc3/build/i686-pc-linux-gnu/libjava/../libstdc++-v3/libsupc++ -L/x1/gcc3/build/i686-pc-linux-gnu/libstdc++-v3/src -L/x1/gcc3/build/i686-pc-linux-gnu/libstdc++-v3/src/.libs -lm -L/x1/gcc3/build/gcc -lc -lgcc_s -lpthread -ldl  '

I haven't yet tracked down where that -lc comes from.

Alexandre> What I don't understand is why libgcj is linked with
Alexandre> libsupc++, and not with libstdc++.

We don't need or want libstdc++.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]