Re: g++ and -nostdlib

Bob Friesenhahn <[email protected]>
Newsgroups gmane.comp.gnu.libtool.patches,gmane.comp.gnu.libtool.general
Message-ID <[email protected]>
On Fri, 8 Nov 2013, Peter Rosin wrote:

> Hi!
>
> There seem to be a longstanding complaint that libtool is using
> -nostdlib when it links libraries using g++. It interferes with
> -pthread and I think I have also seen other issues. No one can
> give a satisfactory explanation why libtool does this, it seems

Isn't it because libtool wants to control the order of the linking and 
assure that all dependencies (including static) are tracked/known and 
applied at the correct times?  It wants to assure that static 
dependencies are linked into the dependent program rather than into 
some dependent shared library (and thus causing a problem).

It was common (and perhaps still is) for the GNU C++ library to be 
delivered as a static library for Windows/MinGW because C++ exceptions 
were not handled properly when thrown by DLLs.

Quite a lot of effort went into making this work the way it currently 
does.

First libtool tries to take away all of the libraries which would be 
added automatically and then it applies the libraries that GCC says it 
would use at the correct time.

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.