Summary: | inconsitency between gcc and g++ when linking with --as-needed | ||
---|---|---|---|
Product: | gcc | Reporter: | Peter <pva> |
Component: | driver | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs |
Priority: | P3 | ||
Version: | unknown | ||
Target Milestone: | 9.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: |
Description
Peter
2007-05-01 19:41:50 UTC
I think this is really a libtool bug passing -nostdlib to g++, there is no reason why it should be doing that anyways. Also --as-needed is a binutils option, since the pthreads library is not needed by the main program, it is needed by the shared library libgigabase_r.so, ld is not adding it to the link line which is the correct thing so libgigabase_r.so needs to link against libpthreads.so to be correctly done. libtool bug was discussed earlier: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 But this bug is not about libtool. Libtool just expose problem, although it should hide but that is another bug. I may wish to have library not dependent on -pthread not linking with libpthread. Then further linking with this library for gcc succeeds, while for g++ not and this is what this bug is about. May be this should be fixed in gcc, but as gcc works and even it does some specific actions it seems to me that more natural fix will be to add same magic to g++. But proper solution is up to gcc maintainers. |