I have noticed this, however, for example:
# ldconfig -v | egrep '^/|libgmp'
/lib:
/usr/lib:
libgmp.so.3 -> libgmp.so.3.3.2
/usr/local/binutils-2.18/lib:
/usr/local/gettext-0.17/lib:
/usr/local/gmp-4.2.2/lib:
libgmp.so.3 -> libgmp.so.3.4.2
/usr/local/mpfr-2.3.1/lib:
/usr/local/mysql5/lib/mysql:
/usr/local/lib:
...
I would like the newer libgmp to be seen first. I do not want to delete
the old one yet (which would work.)
I tried putting /lib and /usr/lib after the line with
/usr/local/mysql5/lib/mysql, but that doesn't work:
# ldconfig -v | egrep '^/'
ldconfig: Path `/lib' given more than once
ldconfig: Path `/usr/lib' given more than once
/lib:
/usr/lib:
...
And they still end up at the top. I've checked the man pages and search
google but haven't been able to find a solution.
Thanks.
--
szr
> I would like the newer libgmp to be seen first. I do not want to delete
> the old one yet (which would work.)
....
> And they still end up at the top. I've checked the man pages and search
> google but haven't been able to find a solution.
Which man pages? Clearly not the one which matters, ld.so(8).
Look for PRELOAD.
Thank you for your reply. I looked at that already, and I don't think
that's what I need.
I simply want to arrange my /etc/ld.so.conf so it will accept entries
before /lib and /usr/bin, which seem to always be implicitly at the
beginning.
--
szr
>> Which man pages? Clearly not the one which matters, ld.so(8). Look for
>> PRELOAD.
> I simply want to arrange my /etc/ld.so.conf so it will accept entries
> before /lib and /usr/bin, which seem to always be implicitly at the
> beginning.
The run-time link editor will *always* look to /lib then /usr/lib first
unless you override that with LD_PRELOAD.
Of course, your other option is simply to remove the library which you do
not want loaded.
Thanks. LD_PRELOAD is for pre loading shared libs. I just want to add
paths to the search list before /lib and /usr/lib
--
szr
You mentioned only *one* library. That is what LD_PRELOAD is for.
You can't do it by hacking on /etc/ld.so.conf. Using LD_LIBRARY_PATH or
LD_RUN_PATH may work, but do *not* set that in your user's environment.
Write a shell script to exec your binary.