This is a discussion on how to prempt /lib and /usr/lib in /etc/ld.so.conf ? within the Linux General forums, part of the Linux Forums category; I'm in the process upgrading things on my Linux system, and for most things I'm using ./configure --prefix=/...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I'm in the process upgrading things on my Linux system, and for most
things I'm using ./configure --prefix=/usr/local/<name>-<version> and after it's "make install"'ed I update include and lib search paths accordingly. 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 |
|
|||
|
On Mon, 12 May 2008 10:13:06 -0700, szr wrote:
> 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. |
|
|||
|
Dave Uhring wrote:
> On Mon, 12 May 2008 10:13:06 -0700, szr wrote: > >> 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 |
|
|||
|
On Mon, 12 May 2008 12:31:08 -0700, szr wrote:
> Dave Uhring wrote: >> 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. |
|
|||
|
Dave Uhring wrote:
> On Mon, 12 May 2008 12:31:08 -0700, szr wrote: >> Dave Uhring wrote: > >>> 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 |
|
|||
|
On Mon, 12 May 2008 14:01:45 -0700, szr wrote:
> Dave Uhring wrote: >> On Mon, 12 May 2008 12:31:08 -0700, szr wrote: >>> 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 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. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|