linux-l: ldd Ungereimtheit

Peter J. Weyers peter at pooh.in-berlin.de
Di Jul 14 19:26:37 CEST 1998


On Tue, 14 Jul 1998, Michael Wiedmann wrote:

> Ich hatte damals so ziemlich alles probiert und bin schliesslich bei der
> jetzigen Loesung gelandet. Mir ist es einfach nicht gelungen, mittels
> "-lxxx" eine Lib statisch und eine andere dynamisch zu linken.

Hm. Und wenn Du die dynamische mit -l und die statische mit vollem Pfad
und Namen angibst?

> Das schaue ich mir noch mal an, obwohl das GCC-HOWTO keine Variable solchen
> Namens kennt.

(peter at woozle) ~ $ strings /usr/bin/ld | grep LD_RUN
LD_RUN_PATH
(peter at woozle) ~ $ 

:-)

info ld(Options):

`-rpath DIR'
     Add a directory to the runtime library search path.  This is used
     when linking an ELF executable with shared objects.  All `-rpath'
     arguments are concatenated and passed to the runtime linker, which
     uses them to locate shared objects at runtime.  The `-rpath'
     option is also used when locating shared objects which are needed
     by shared objects explicitly included in the link; see the
     description of the `-rpath-link' option.  If `-rpath' is not used
     when linking an ELF executable, the contents of the environment
     variable `LD_RUN_PATH' will be used if it is defined.

[...]


     The linker uses the following search paths to locate required
     shared libraries.

       [...]

       3. On an ELF system, if the `-rpath' and `rpath-link' options
          were not used, search the contents of the environment variable
          `LD_RUN_PATH'.

       [...]

       5. For a native linker, the contents of the environment variable
          `LD_LIBRARY_PATH'.

Hm. Macht etwas mehr, als Du willst ...

Gruss,
Peter






Mehr Informationen über die Mailingliste linux-l