make: add support for RISC-V Clang-based toolchain
@@ -121,13 +121,17 @@ TOOLCHAIN_cortex-m7 := arm-none-eabi
# RISC-V toolchains, irrespective of their name-tuple, can compile for
# essentially any target. Thus, try a few known names and choose the one for
-# which a gcc is found.
+# which a compiler is found.
ifneq (,$(shell which riscv64-none-elf-gcc 2>/dev/null))
TOOLCHAIN_rv32i := riscv64-none-elf
else ifneq (,$(shell which riscv32-none-elf-gcc 2>/dev/null))
TOOLCHAIN_rv32i := riscv32-none-elf
else ifneq (,$(shell which riscv64-elf-gcc 2>/dev/null))
TOOLCHAIN_rv32i := riscv64-elf
+else ifneq (,$(shell which riscv64-unknown-elf-clang 2>/dev/null))
+ TOOLCHAIN_rv32i := riscv64-unknown-elf
+else ifneq (,$(shell which riscv32-unknown-elf-clang 2>/dev/null))
+ TOOLCHAIN_rv32i := riscv32-unknown-elf
else
# Fallback option. We don't particularly want to throw an error (even if
# RISCV=1 is set) as this configuration makefile can be useful without a
