gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] RPATH makes my head hurt


From: Hal Murray
Subject: Re: [gpsd-dev] RPATH makes my head hurt
Date: Fri, 06 Dec 2013 00:44:47 -0800

address@hidden said:
> Before I go into those, I repeat my plea for someone to find out and tell me
> how to query what the system default load path is.  If I knew that, I'd set
> RPATH only when libdir isn't on the default path and we wouldn't have any
> special cases or controversies. 

Sorry, but I think it's going to depend on the OS and/or distro.

On NetBSD:
  man ld.so says look in ld.aout_so or ld.elf_so
ld.elf_so says:
     The linker will search for libraries in three lists of paths:

     1.   A user defined list of paths as specified in LD_LIBRARY_PATH and
          ld.so.conf(5).

          The use of ld.so.conf should be avoided as the setting of a global
          search path can present a security risk.

     2.   A list of paths specified within a shared object using a DT_RPATH
          entry in the dynamic section.  This is defined at shared object link
          time.

     3.   The list of default paths which is set to /usr/lib.

----------

I haven't found a similarly helpful man page on FreeBSD.

The wikipedia article on RPATH says that Solaris looks in LD_LIBRARY_PATH 
before DT_RPATH

------------

The Linux man page for ld.so/ld-linux.so says:

       If a library dependency does not contain a slash, then it  is  searched
       for in the following order:

       o  (ELF  only)  Using the directories specified in the DT_RPATH dynamic
          section attribute of the binary if present and DT_RUNPATH  attribute
          does not exist.  Use of DT_RPATH is deprecated.

       o  Using  the environment variable LD_LIBRARY_PATH.  Except if the 
exe‐
          cutable is a set-user-ID/set-group-ID binary, in which  case  it  is
          ignored.

       o  (ELF only) Using the directories specified in the DT_RUNPATH dynamic
          section attribute of the binary if present.

       o  From the cache file /etc/ld.so.cache, which contains a compiled list
          of  candidate  libraries  previously  found in the augmented library
          path.  If, however, the binary  was  linked  with  the  -z  nodeflib
          linker  option,  libraries in the default library paths are skipped.
          Libraries installed in hardware capability directories  (see  below)
          are preferred to other libraries.

       o  In  the  default  path  /lib,  and then /usr/lib.  If the binary was
          linked with the -z nodeflib linker option, this step is skipped.

So it's /lib then /usr/lib (no mention of 32 vs 64)

-----------

It looks like we may be able to make scons check work on Linux with 
LD_LIBRARY_PATH if we link with RUNPATH rather than RPATH.


-- 
These are my opinions.  I hate spam.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]