Hi Dale, hi Theo,

On Tue, 29.12.2009 at 11:55:55 -0600, Dale Rahn <dr...@dalerahn.com> wrote:
> On Tue, Dec 29, 2009 at 06:03:48PM +0100, Toni Mueller wrote:
> > I've just seen a program fail to work, saying that it can't load a
> > shared library (but a different one on each invocation - this is an SMP
> > machine). Then I found out that /usr/local/lib was not part of the
> > scanned directories. Looking into

I have now discovered that I overlooked the setting of /usr/local/lib
in /etc/rc. But it seems to mean that I have to re-run ldconfig
every time I install a new shared library, or programs depending on it
won't find it.

Why the program reported a different library name missing on every
invocation (out of the set of libs it wants, that is), I still don't
know. Will use the debugging technique you mention below.

> > http://www.openbsd.org/cgi-bin/cvsweb/src/libexec/ld.so/ldconfig/library.c?rev=1.2;content-type=text%2Fplain
> > 
> > I see this:
> > 
> > #define DEFAULT_PATH "/usr/lib:/usr/X11R6/lib:/usr/local/qte/lib"
> 
> shlib.c:#define STANDARD_SEARCH_DIRS    "/usr/lib"
> 
> is the define you are really looking for.

Ok.

> The DEFAULT_PATH is part of the never really used 'prebind' system,
> much like prelink on linux.

I guess that I need to do some background reading to make sense of
this.

> The system normally adds additional search paths that can be displayed
> using:
> ldconfig -r | head -2

Thanks for the idea. It turns out that my systems emit long lists of
directories that include directories within my ports tree, from ports I
built. I'm not so sure that this is what I want (what if I run 'make
clean' there?). I also don't see how these directories got in the
search path in the first place.

> The tool only uses /usr/lib to be as conservative as possible, it allows the
> user (or startup environment) to control the addition of other directories.

I didn't fiddle with ldconfig's startup environment and expected the
search path to be as the system had set them.

> However this does not explain the original problem you were having, I
> would suggest running the application with 'LD_DEBUG' environment set
> eg: LD_DEBUG='' a.out [args]

I'll try to reproduce the problem shortly.


-- 
Kind regards,
--Toni++

Reply via email to