Subject: Re: static vs. dynamic runtime linking, again (was: PAM and su -K)
To: NetBSD Userlevel Technical Discussion List <tech-userlevel@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 01/24/2005 18:17:31
> It's outright dislike and disgust of the clear and dramatic technical
> consequences and measurable costs and overhead of dynamic linking.

I just ran into one myself, just yesterday.

I was dealing with a new 2.0 install.  I tried to link an X program.
The linker couldn't find -lXext -lX11.  So I added -L/usr/X11R6/lib
(from relatively hazy memory) and it found them - and promptly fell
over when I tried to run it, saying it couldn't find some libXext.so
file.

At that point I added -static and the problems went away.  Now, it's
possible that my -L option was wrong, or insufficient, or something; I
didn't bother trying to grovel thorugh the manpages to figure it out.

But I consider it catastrophically broken for a link to succeed and
then executing the resulting binary, with no intevening changes such as
library files disappearing, to fail for a reason that's wholly
predictable at link time.  (It's fine to be able to cross-link and
such, or to link for a system that has the .so files in other places.
But that should be the unusual case.)

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B