|
From: Tom H. <th...@cy...> - 2004-10-13 09:46:52
|
In message <20041013091016.GA6518@malin>
Karl Hasselström <kh...@tr...> wrote:
> On 2004-10-12 19:05:39 +0100, Tom Hughes wrote:
>
>> It should use it automatically. One thing that might cause a problem
>> is having an rpath set in your executable - what does "objdump -p"
>> say about your program?
>
> RPATH
> /home/kha/local/lara.hq.vtech/lib:/home/kha/local/generic/lib:/usr/X11R6/lib:/usr/lib:/lib:/usr/local/lib
>
> which is exactly the same as my $LD_LIBRARY_PATH. Valgrind is
> installed in /home/kha/local/lara.hq.vtech, which means that the full
> path to the library is
> /home/kha/local/lara.hq.vtech/lib/valgrind/libpthread.so.
The RPATH is your problem - you have /lib in there so the libpthread
in /lib will be found via the RPATH before LD_LIBRARY_PATH is searched
which is what would locate the valgrind version.
The way things are supposed to work is that valgrind adds it's own
library directory to LD_LIBRARY_PATH before starting the client
program so that the valgrind pthread library is found. Unfortunately
because RPATH takes priority over LD_LIBRARY_PATH (see man ld.so for
the search rules) the system one is being found first.
It's highly unusual to add the system library directories to the
RPATH in that way - normally you just add any special directories that
your program needs and let the system do it's default stuff to find
the system libraries.
I would suggest that you either drop the system libraries from RPATH,
use RUNPATH instead of RPATH, or add the valgrind library directory to
the RPATH so that valgrind pthread library is found.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|