Subject: Re: static vs. dynamic runtime linking, again (was: PAM and su -K)
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Jachym Holecek <freza@liberouter.org>
List: tech-userlevel
Date: 01/25/2005 00:38:32
> > 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.

You forgot -Wl,-rpath,/usr/X11R6/lib -- there's a huge number of
software packages (outside Pkgsrc) that still don't get dynamic
linking right. The conclusion is that their authors should just
forget LD_LIBRARY_PATH + /etc/ld.so.conf and repair their build
frameworks.

	Regards,
		-- Jachym Holecek