This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: static_link_warning
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: Stanisław Findeisen <stf at eisenbits dot homelinux dot net>
- Cc: libc-help at sourceware dot org
- Date: Thu, 19 Aug 2010 12:11:51 -0400
- Subject: Re: static_link_warning
- References: <4C6CD770.9050601@eisenbits.homelinux.net>
2010/8/19 StanisÅaw Findeisen <stf@eisenbits.homelinux.net>:
> Sometimes when you statically link programs with GNU C Library you get
> warnings like this:
>
>> warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
>
> Could anyone please explain to me what it means and why is it so?
Somenetwork functions rely on NSS to perform the lookup operations.
NSS can be configured to use several different modules. The support
for these modules is provided by dynamically opening the required
module and calling the appropriate functions therein.
Even if you have a static application, if you make certain function
calls, it may dynamically load the appropriate NSS module. Once you
dynamically load a module you need all the shared libraries to be
installed to support the module.
The shared libraries must be from the version of glibc used for
linking to ensure structures match the expected sizes in the static
application.
I hope that helps.
Cheers,
Carlos.