I would like to propose extending the BareMetal toolchain to support using an existing GCC installation, and then deprecating and removing the RISCVToolChain.
I can’t speak for the RISCV toolchain itself, would very much like to see the functionality in the BareMetal toolchain so all targets that support it can benefit.
We (the ChromeOS LLVM Toolchain at Google) would like to propose a similar (perhaps less-experimental and more formal) upstream change. That is, checking to see whether we are GCC-Adjacent in the first place is opt-in behaviour, configured by flags passed to Clang rather than the default of baremetal.
This logic was introduced before the --cstdlib option, now that we have this option we should be able to use it to also select crtbegin.o, crtend.o and -lgloss.
Oh interesting! So the gccadjacent detection work here is redundant with –cstdlib? To be clear, we don’t have crtbegin.o or crtend.o or libgloss, but we do use glibc. It’s just auto-detecting that we do incorrectly because another toolchain outside of /usr/armv7m-none-eabi has crt0.o.