HomePhabricator

[clang][Driver] Handle risvc in Baremetal.cpp.

Authored by abidh on Nov 26 2020, 3:31 AM.

Description

[clang][Driver] Handle risvc in Baremetal.cpp.

I am working on a baremetal riscv toolchain using LLVM runtime and
LLD linker. Baremetal.cpp provides most of the things needed for such
toolchain. So I have modified it to also handle riscv64/32-unknown-elf
targets alongside arm-none-eabi.

Currently, targets like riscv64-unknown-elf are handled by RISCVToolChain
which mostly expects a gcc toolchain to be present. If you dont
want the dependency on gcc-toolchain/libgloss or want to use LLD, then
RISCVToolChain is not a good fit.

So in the toolchain selection code, I have made this dependency of
RISCVToolChain on gcc toolchain explicit. It is created if gcc-toolchain
option is present. Otherwise Baremetal toolchain is created. I will be
happy to hear if there is a better way to choose between these two
toolchains.

Reviewed By: jroelofs

Differential Revision: https://reviews.llvm.org/D91442

Details

Committed
abidhNov 26 2020, 3:43 AM
Reviewer
jroelofs
Differential Revision
D91442: [clang][Driver] Handle risvc in Baremetal.cpp.
Parents
rG5641b1dfddff: [libc++] Mark a few more tests as unsupported on gcc-8/9.
Branches
Unknown
Tags
Unknown