title: How can I make my Rust program link to another glibc?
body: <p>I have a <code>crosstool-ng</code> toolchain for <code>i686-linux-unknown-gnu</code>, this toolchain contains a different glibc than the one installed in my host.</p>
  
  <p>The path to my <code>libc.so.6</code> is:</p>
  
  <pre><code>~/x-tools/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/lib
  </code></pre>
  
  <p>How can I tell Cargo to link to the glibc located in this directory instead of the system one?</p>
  
  <p>I have already tried <code>LD_LIBRARY_PATH</code>, but it doesn't work.</p>
  
  <p>What works is to set in my <code>.cargo/config</code> file this:</p>
  
  <pre><code>[target.i686-unknown-linux-gnu]
  linker = "i686-unknown-linux-gnu-gcc"
  </code></pre>
  
  <p>But that links my program with the GCC toolchain instead of Clang. I want to use Clang and just link against a different glibc.</p>