Static linking considered harmful

Jakub Jelinek jakub at redhat.com
Wed Nov 22 10:41:19 UTC 2006


On Wed, Nov 22, 2006 at 11:24:28AM +0100, Patrice Dumas wrote:
> Not only. There are cases when all those issues are moot, a prominent one 
> being for numerical models. Compiling models statically makes it possible
> to run them on any other linux (including different fedora version) box 
> without recompiling.

That's a myth, static linking decreases portability, e.g. because statically
linked binaries have the dynamic linking code compiled statically into the
binary, thus they can't deal with new system shared libraries, new iconv
modules, nss modules, locale data formats, etc.  And, most of statically
linked programs touch one of those areas, many functions use nss services,
stdio uses internally iconv, many functions deal with locales, etc.
E.g. all shared libraries in FC6 except those from glibc rpm can't be
understood by FC5 or earlier dynamic linker or dynamic linking code
linked into statically linked programs.

	Jakub




More information about the fedora-devel-list mailing list