title: Configuring cross-compiler to use custom library search path
body: <p>I created a cross-toolchain for ARM (Raspberry Pi, to be specific). It's library search order is as follows:</p>
  
  <pre><code>armv6j-hardfloat-linux-gnueabi-gcc -print-search-dirs | grep libraries | sed "s/:/\n/g"
  
  libraries
   =/usr/lib/gcc/armv6j-hardfloat-linux-gnueabi/4.7.2/
  /usr/lib/gcc/armv6j-hardfloat-linux-gnueabi/4.7.2/../../../../armv6j-hardfloat-linux-gnueabi/lib/armv6j-hardfloat-linux-gnueabi/4.7.2/
  /usr/lib/gcc/armv6j-hardfloat-linux-gnueabi/4.7.2/../../../../armv6j-hardfloat-linux-gnueabi/lib/
  /usr/armv6j-hardfloat-linux-gnueabi/lib/armv6j-hardfloat-linux-gnueabi/4.7.2/
  /usr/armv6j-hardfloat-linux-gnueabi/lib/
  /usr/armv6j-hardfloat-linux-gnueabi/usr/lib/armv6j-hardfloat-linux-gnueabi/4.7.2/
  /usr/armv6j-hardfloat-linux-gnueabi/usr/lib/
  </code></pre>
  
  <p>And I would like to add</p>
  
  <pre><code>/usr/armv6j-hardfloat-linux-gnueabi/usr/local/lib/
  </code></pre>
  
  <p>to it.
  As far as I know, cross-compilers ignore LIBRARY_PATH and have fixed search order.
  But - is there any possibility to alter this search order at build time - i.e. when creating cross-toolchain? Maybe some ./configure options for gcc, or environment variables then?</p>
  
  <p>I have seen some cross-toolchain, which had non-standard (but still fixed) library search order. Were they specified by ./configure options or similar mechanism, or was gcc hacked to achieve this?</p>