0
votes

I'm trying to use clang to make IR for riscv64.

When I use llc --version, it shows many targets including riscv64.

But when I use the following command:

clang -target riscv64 hello.c
clang -target riscv64-unknown-linux hello.c

It shows clang-4.0: error: unknown target triple 'riscv64-unknown-linux', please use -triple or -arch

I'm not using ucb-bar's llvm for riscv. I'm using riscv from upstream of llvm.org.

Did I do something wrong or do I have to do something before building llvm?

1

1 Answers

0
votes

Try elf instead of linux.

clang -target riscv32-unknown-elf
clang -target riscv64-unknown-elf

Edit: I created this repo for everyone interested in using RISC-V with LLVM.