2

A couple of answers mention the LD_RUNPATH environment variable:

but I couldn't find any description or official reference, including in the ld(1) and ld.so(8) Linux man pages. It seems that the goal is to have a lower precedence than LD_LIBRARY_PATH, particularly useful under Solaris, where LD_LIBRARY_PATH overrides everything.

A search on Google shows some discussions involving LD_RUNPATH, but nothing concrete. A search on Wikipedia is also unsuccessful. I also did some compilation/run tests with shared libraries under GNU/Linux and Solaris, but couldn't notice any effect.

So, what is this environment variable? Is there any official documentation?

Community
  • 1
  • 1
vinc17
  • 2,829
  • 17
  • 23
  • Also see [What exactly does --enable-new-dtags do?](https://sourceware.org/ml/binutils/2005-04/msg00060.html), which actually references a Sun document. The cited Sun document is available on the [Wayback Machine](https://web.archive.org/web/20090609224414/http://docsun.cites.uiuc.edu/sun_docs/C/solaris_9/SUNWdev/LLM/p55.html), and it looks a lot like current documents. – jww Feb 17 '18 at 09:12

3 Answers3

2

There is no LD_RUNPATH. Most likely this is a typo of LD_RUN_PATH or DT_RUNPATH.

Regarding DT_RUNPATH, TechBlog says:

The DT_RUNPATH value is set with the linker options -rpath (or LD_RUN_PATH) and the –enable-new-dtags.

Armali
  • 18,255
  • 14
  • 57
  • 171
-1

Sorry, did not fully understand (or read enough :) ), in the ld(1) manual you have the answer: LD_RUN_PATH is used to initialise the run path if the -rpath option is not used.

P. Morel
  • 76
  • 3
  • 1
    I know `LD_RUN_PATH`, but note that [it isn't taken into account by *gold*](https://sourceware.org/bugzilla/show_bug.cgi?id=13764). Moreover I was asking about `LD_RUNPATH`. I was wondering whether this was a typo, but it is said that it has a lower precedence than `LD_LIBRARY_PATH`, which is not the case of `LD_RUN_PATH` under GNU/Linux (according to tests, `LD_RUN_PATH` yields `DT_RPATH` in the binary, not `DT_RUNPATH`). – vinc17 Oct 09 '14 at 16:15
-2

You may find interresting informations on GNU GCC pages or on Linux documentation project.

See:

http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

P. Morel
  • 76
  • 3
  • 3
    Neither the GCC manual nor the tldp.org link you gave mentions `LD_RUNPATH`, which is my specific question. – vinc17 Oct 09 '14 at 15:37