title: How can I compile with LLVM/Clang to RISC-V target?
body: <p>I want to compile a simple program "int main(){return 0;}" to RISC-V processor.
  LLVM/Clang version is 9.0 and I want to run the compiled program with a RISC-V simulator like this <a href="https://github.com/riscv/riscv-tools" rel="noreferrer">https://github.com/riscv/riscv-tools</a> </p>
  
  <p>My problem is that I can't list the clang supported targets only the LLC-s whith these commands:</p>
  
  <pre><code>llc --version
  llc -march=xxARCHTYPExx -mattr=help
  </code></pre>
  
  <p>And there is no any type of riscv processor listed.</p>
  
  <p>So I tried to look the triple file: <code>llvm-project\llvm\include\llvm\ADT\Triple.h</code></p>
  
  <p>and try a command like: <code>clang hello.c -target riscv32 -march=rv32imafd</code></p>
  
  <p>But I get the following error:</p>
  
  <blockquote>
    <p>error: unable to create target: 'No available targets are compatible
    with triple "riscv32"'</p>
  </blockquote>
  
  <p>Can somebody help me to how get a valid RISC-V target? I just simple can't compile the program but I know LLVM has a RISC-V support.</p>