Static linking considered harmful

Jakub Jelinek jakub at redhat.com
Tue Nov 28 17:44:53 UTC 2006


On Tue, Nov 28, 2006 at 06:30:47PM +0100, Olivier Galibert wrote:
> > For the first category (e.g. glibc, libX11), the rule of thumb is
> > link dynamically, don't include the libraries with your program,
> > compile and link against the oldest version you still want to support.
> 
> Ah but you see, glibc does not maintain backwards compatilibity.
> 
> ./nscube: relocation error: ./nscube: symbol errno, version GLIBC_2.0 not defined in file libc.so.6 with link time reference

This is a bug in the application for which we just provided workarounds
for several years, of course the ISV must compile a correct valid program,
not everything that happens to link is valid.  If you'd require that
any buggy program keeps working, we'd need to guarantee bug to bug
compatibility, that's not something any library guarantees.
POSIX says that errno may be a macro (and since glibc 2.1.0 it is a macro)
and that <errno.h> must be included when it is used, so programs that
don't bother with it are out of luck.

	Jakub




More information about the fedora-devel-list mailing list