title: How to cross compile gdbserver to different platform?
body: <p>I'm trying to compile gdbserver for the purpose of remote debugging on an embedded MIPs platform. I have a cross compiler GCC, binutils, and gdb compiled for the platform. </p>
  
  <p>My configure command is as so</p>
  
  <pre><code>../gdb-7.6/gdb/gdbserver/configure --target=$TARGET --prefix=$PREFIX --target=$TARGET --build=x86_64-unknown-linux-gnu
  </code></pre>
  
  <p>However, it keeps building with my system compiler rather than the cross-compiler, so I get errors. How can I configure this to build with the cross compiler so that I can run gdbserver on the embedded platform and then debug it from my PC? </p>