Static linking considered harmful

Jakub Jelinek jakub at redhat.com
Wed Nov 22 17:10:55 UTC 2006


On Wed, Nov 22, 2006 at 11:36:17AM -0500, Tony Nelson wrote:
> Users of numerical models often want bit-reproducable results.  It's not
> necessarily stupid, as if the results are identical no further comparison
> is needed, while if the results are merely "close", much thought must go
> into deciding whether they are close enough.

For bit-reproduceable results you want the same CPUs too, some parts of libm
check hwcaps and adjust based on that.

Anyway, this kind of use is quite rare, as opposed to thousands of people
out there who just have a warm fuzzy feeling that their programs are
portable when they link statically without understanding all the issues
involved.

If you want bit-reproduceable results, you can equally well
just stick the shared libraries you need into the same directory as the
program and run it as
./ld-linux*.so.2 --library-path . ./the_numerical_program arguments
it will cost you just a few extra lines in the Makefile, IMHO not a big
deal.

	Jakub




More information about the fedora-devel-list mailing list