title: Link against different glibc
body: <p>I installed glibc-2.18 into my home directory and want to link an application against it:</p>
  
  <pre><code>$ g++ -pthread -o tsx_test tsx_test.cpp -Wl,--rpath=/home/hl/lib/ \
    -Wl,--dynamic-linker=/home/hl/lib/ld-linux-x86-64.so.2
  </code></pre>
  
  <p>Compiling and linking works fine using g++4.7.3, however, fails when executing it: </p>
  
  <pre><code>$ ./tsx_test
  ./tsx_test: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>/usr/lib/x86_64-linux-gnu/libstdc++.so.6 definitely exists, when I compile without "--rpath" the same libstdc++.so.6 is linked and everything works fine.</p>
  
  <pre><code>$ ldd tsx_test
  linux-vdso.so.1 =&gt;  (0x00007fff42bd4000)
  libstdc++.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f42aa3aa000)
  libgcc_s.so.1 =&gt; /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f42aa194000)
  libpthread.so.0 =&gt; /home/hl/lib/libpthread.so.0 (0x00007f42a9f75000)
  libc.so.6 =&gt; /home/hl/lib/libc.so.6 (0x00007f42a9bc8000)
  libm.so.6 =&gt; /home/hl/lib/libm.so.6 (0x00007f42a98c5000)
  /home/hl/lib/ld-linux-x86-64.so.2 =&gt; /lib64/ld-linux-x86-64.so.2 (0x00007f42aa6c9000)
  </code></pre>