This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: LD_LIBRARY_PATH foo:


Jakub Jelinek <jakub@redhat.com> writes:

> What's the reason why glibc ld.so handles empty paths in LD_LIBRARY_PATH
> and RPATH/RUNPATH as current directory instead of skipping?
> I've just checked what Solaris ld.so does and it looks like it is skipping
> empty paths both in LD_LIBRARY_PATH and RPATH/RUNPATH, and Sun shell scripts
> apparently cannot be bothered to check for null LD_LIBRARY_PATH before
> prepending something to it.

I haven't checked Solaris but it seems unlikely that they do this
since it violates the gabi.  The section named Shared Object
Dependencies contains:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* The dynamic array tag DT_RUNPATH gives a string that holds a list of
  directories, separated by colons (:). For example, the string
  /home/dir/lib:/home/dir2/lib: tells the dynamic linker to search
  first the directory /home/dir/lib, then /home/dir2/lib, and then the
  current directory to find dependencies.

[...]

* A variable called LD_LIBRARY_PATH in the process environment [see
  exec(BA_OS)] may hold a list of directories as above, optionally
  followed by a semicolon (;) and another directory list. The
  following values would be equivalent to the previous example:

    * LD_LIBRARY_PATH=/home/dir/usr/lib:/home/dir2/usr/lib:

    * LD_LIBRARY_PATH=/home/dir/usr/lib;/home/dir2/usr/lib:

    * LD_LIBRARY_PATH=/home/dir/usr/lib:/home/dir2/usr/lib:;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]