bug#34219: libtool cannot statically link dependencies into shared C++ library

Bob Friesenhahn <[email protected]>
Newsgroups gmane.comp.gnu.libtool.bugs
Message-ID <[email protected]>
On Sun, 27 Jan 2019, Ulya Trofimovich wrote:

> Hello!
>
>
> I'm trying to build a portable DLL for windows with libtool. To do that,
> I need to eliminate dynamic dependencies on libstdc++ and libgcc. With
> GCC it is normally done by passing -static-libstdc++ -statlic-libgcc to
> the linker.

Usually people are using MinGW64 GCC to build DLLs for Windows.  What 
GCC are you using?  Is this a native Windows build or are you 
cross-compiling?

> Even though options -static-libstdc++ -static-libgcc are passed to the
> linker, hard-coded -nostdlib
> /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../lib64/crti.o
> /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/crtbeginS.o pulls in dynamic
> dependencies.

Libtool applies the libraries that GCC claims that it will use.

Libtool is a portability tool (supporting set of features commonly 
used and available on many platforms) and not intended to support 
all use cases.

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt
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.