title: use RPATH but not RUNPATH?
body: <p><a href="https://web.archive.org/web/20120418232524/http://labs.qt.nokia.com/2011/10/28/rpath-and-runpath/" rel="nofollow noreferrer">This page</a> says about order for library search in <code>ld.so</code>:</p>
  <blockquote>
  <pre class="lang-none prettyprint-override"><code>Unless loading object has RUNPATH:
      RPATH of the loading object,
          then the RPATH of its loader (unless it has a RUNPATH), ...,
          until the end of the chain, which is either the executable
          or an object loaded by dlopen
      Unless executable has RUNPATH:
          RPATH of the executable
  LD_LIBRARY_PATH
  RUNPATH of the loading object
  ld.so.cache
  default dirs
  </code></pre>
  </blockquote>
  <p>And then suggests:</p>
  <blockquote>
  <p>When you ship binaries, either use RPATH and not RUNPATH or ensure
  LD_LIBRARY_PATH is set before they are run.</p>
  </blockquote>
  <p>So, using <code>RPATH</code> with <code>RUNPATH</code> is bad because <code>RUNPATH</code> kind-of cancels <code>RPATH</code> so indirect dynamic loading doesn't work as expected? But why then <code>RPATH</code> got deprecated in favor of <code>RUNPATH</code>?</p>
  <p>Can somebody explain the situation?</p>