Subject: How does a ELF system find libs at runtime?
To: None <>
From: Thorsten Frueauf <>
List: tech-pkg
Date: 01/04/1999 10:34:59

After I got a very old scsi disk with some space for my DECstation
5000/200, and after I patched the 1.3.3 kernel with the old asc driver
from 1.2G (thanx to Greg Wohletz for that hint!), the thing is running
quite stable and I thought its a good oportunity to compile some
packages for that arch.

I found out that pksrc/editors/{xemacs20,emacs} are defnitly not
ready for pmax/mips yet, looking at ${WRKSRC}/src/m/{mips.h,pmax.h}
its very clear that this needs further porting to make this work.
Same with pkgsrc/www/mozilla, which misses serveral definitions.
I will set "NOT_FOR_ARCHS=mips" in those Makefiles.

But to my real problem:

Apart from above packages I was very surprised that all others I tried
build and installed pretty flawlessly. But there seems something
magic about ELF/pmax I did not understand yet:

How does the system determine where to look for libs at runtime?

I did build/install pkgsrc/x11/xlockmore, but if I start it, it
complains about not finding - but of course its
in /usr/X11R6/lib - same goes with the Mesa libs. They are
installed in /usr/X11R6/lib with the appropriate links
(e.g. linked to and

Obviously there is nothing like ldconfig, but I have
/usr/{pkg,X11R6}/lib in /etc/ just to be sure - thats not the

But I was really surprised to see, if I make links from
/usr/X11R6/lib/libXpm.* to /usr/local/lib (same with the Mesa libs)
xlock suddenly finds the libs and works.

So what did I miss? Do ELF systems have some paths hardcoded in some
kind of path.h where they search?

If so, I would propose to add /usr/X11R6/lib and /usr/pkg/lib there
too, since /urs/local/lib is already there...

Thanx for any enlightment in advance :)

   Name  : Thorsten Frueauf            Milano@irc cri@onaliM       //
   E-Mail: oder     \X/