[all-commits] [llvm/llvm-project] 45ba23: [clang][Driver] Handle risvc in Baremetal.cpp.

abidh via All-commits all-commits at lists.llvm.org
Thu Nov 26 03:44:20 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 45ba2392d7e00aedd4d9fb04070dbae8a7fbbeeb
      https://github.com/llvm/llvm-project/commit/45ba2392d7e00aedd4d9fb04070dbae8a7fbbeeb
  Author: Hafiz Abid Qadeer <abidh at codesourcery.com>
  Date:   2020-11-26 (Thu, 26 Nov 2020)

  Changed paths:
    M clang/lib/Driver/Driver.cpp
    M clang/lib/Driver/ToolChains/BareMetal.cpp
    M clang/lib/Driver/ToolChains/RISCVToolchain.cpp
    M clang/lib/Driver/ToolChains/RISCVToolchain.h
    M clang/test/Driver/baremetal.cpp
    M clang/test/Driver/riscv-gnutools.c
    M clang/test/Driver/riscv32-toolchain-extra.c
    M clang/test/Driver/riscv32-toolchain.c
    M clang/test/Driver/riscv64-toolchain-extra.c
    M clang/test/Driver/riscv64-toolchain.c

  Log Message:
  -----------
  [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




More information about the All-commits mailing list