libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Libtool mishandling of C++ libraries requiring -pthread


From: Russ Allbery
Subject: Libtool mishandling of C++ libraries requiring -pthread
Date: Wed, 01 Feb 2012 15:14:01 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Hello folks,

I just ran into Debian bug #468555:

    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555

which appears to not be something that was introduced in Debian, but is
still a problem in the general Libtool 2.4.2 release.  There is discussion
in that bug log (the libgcc part no longer seems to be an issue), but the
basic summary is that Libtool uses -nostdlib when linking C++ libraries,
and -nostdlib suppresses the action of -pthread at the link phase and
therefore g++ doesn't add -lpthread to the final link.  The result is a
shared library with unresolved pthread symbols.

I think the primary question is why Libtool is using -nostdlib when
linking C++ libraries.  The bug discussion at:

    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460

says that it's because of some other issue with libstdc++ linkage with
dlopened modules depending on C++ libraries, but this dates from 2005, and
breaking C++ libraries that need threading seems like a bad outcome.  Does
this problem still exist?  Can this workaround just be dropped?

Note that the GCC maintainters closed the bug requesting -pthread still
add -lpthread even under -nostdlib as invalid.

-- 
Russ Allbery (address@hidden)             <http://www.eyrie.org/~eagle/>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]