[clang] [clang] Enable --gcc-install-dir for RISCV baremetal toolchains (PR #71803)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 9 12:31:04 PST 2023


MaskRay wrote:

A user has recently asked me about `RISCVToolChain` and I am puzzled by its behavior.

Why is the return value of `RISCVToolChain::hasGCCToolchain` used to choose `toolchains::RISCVToolChain` or `toolchains::BareMetal`? The logic should be decided by the target triple, not whether `--gcc-toolchain=` or `--gcc-install-dir=` is specified or not, or whether `crt0.o` (where does this file come from?) is present or absent.

I have a feeling that RISCVToolchain.cpp only works for certain vendors and other vendors cannot use it, and some builtin rules in RISCVToolchain.cpp are not clear about the choices.

https://github.com/llvm/llvm-project/pull/71803


More information about the cfe-commits mailing list