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

From: Bob Friesenhahn <[email-masked]>
Date: Sun, 27 Jan 2019 19:43:24 -0600 (CST)

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