Thanks for the reply.
Hi,
Michael Hudson-Doyle wrote:
> I recently encountered the problem that the patch "threadlib: Fix
> LIBMULTITHREAD on platforms where --as-needed is enabled" was intended to
> fix. But unfortunately, the fix doesn't actually work because libtool is
> re-ordering the linker commands. In particular "$stuff -Wl,--push-state
> -Wl,--no-as-needed -lpthread -Wl,--pop-state" becomes "-Wl,--push-state
> -Wl,--no-as-needed -Wl,--pop-state $stuff -lpthread" which obviously
> doesn't achieve anything at all.
It sounds like you are using $(LIBMULTITHREAD) when you should in fact
be using $(LTLIBMULTITHREAD). See the module description:
Link:
$(LTLIBMULTITHREAD) when linking with libtool, $(LIBMULTITHREAD) otherwise
This doesn't seem to help. If it did, though, should modules/lock-test and so on be updated to use LTLIBMULTITHREAD? I'm just a distro maintainer stabbing in the dark here!
The way things should work when using libtool is in use is that
* libtool does not see any --push-state or --as-needed options, only
-lpthread or -pthread.
* libtool passes these options to GCC.
* GCC inserts the --push-state and --as-needed options.
I don't understand why gcc would do that?
Cheers,
mwh