[Haskell-cafe] Static Linking Problem

Svein Ove Aas svein.ove at aas.no
Wed Nov 11 11:44:57 EST 2009


On Wed, Nov 11, 2009 at 3:22 PM, MightyByte <mightybyte at gmail.com> wrote:
>
> (.text+0x3068): warning: Using 'getaddrinfo' in statically linked
> applications requires at runtime the shared libraries from the glibc
> version used for linking
>
> But glibc is pretty standard, so I don't think this will be a problem
> for me.  Thanks for the help.
>
You may have unexpected results.

That warning occurs because some of glibc (namely, the getaddrinfo
bit) is dynamically linked regardless of what you want; this is
apparently to make NSS work, or something along those lines.

However, if you then link the rest of glibc statically, you get
dependencies between your program and the installed glibc, for
internal, unstable APIs. (!)

This is generally a Big No. Doing this means your program definitely
won't be compatible with older versions of glibc, but it probably
wouldn't be either way. However, in this case it also won't be
compatible with *newer* versions of glibc.

My recommendation would be to take glibc off the list of statically
linked libraries.


-- 
Svein Ove Aas


More information about the Haskell-Cafe mailing list