title: Cross compile for RISCV
body: <p>I have a C program that I want to compile it for <a href="http://riscv.org/" rel="nofollow">RISCV ISA</a>. I have followed their instruction for installing the tools. Their tools work correctly and I can compile a "Hello world!" C program and run it. But right now I want to compile another C program that contains multiple files. I tried to change the makefile and instead of using gcc, I replace it with their compiler name <code>riscv64-unknown-linux-gnu-gcc</code> but I got:</p>
  
  <p><code> Relocations in generic ELF (EM: 62)</code></p>
  
  <p>error, then I tried to set <code>CC = riscv64-unknown-linux-gnu-gcc</code> but I got another error about <code>pthread</code></p>
  
  <p><code>unrecognized command line option '-pthread'</code></p>
  
  <p>My question is that should I change the make file to use their compiler?</p>
  
  <p>Thanks for your help in advance.</p>