diff --git a/dist/tools/ci/print_toolchain_versions.sh b/dist/tools/ci/print_toolchain_versions.sh index 6b3bb1083a67e..115442887b8c8 100755 --- a/dist/tools/ci/print_toolchain_versions.sh +++ b/dist/tools/ci/print_toolchain_versions.sh @@ -126,6 +126,7 @@ for p in \ arm-none-eabi \ avr mips-mti-elf \ msp430-elf \ + riscv-none-elf \ riscv-none-embed \ xtensa-esp32-elf \ xtensa-esp8266-elf \ @@ -141,6 +142,7 @@ for p in \ arm-none-eabi \ mips-mti-elf \ msp430-elf \ + riscv-none-elf \ riscv-none-embed \ xtensa-esp32-elf \ xtensa-esp8266-elf \ diff --git a/makefiles/arch/riscv.inc.mk b/makefiles/arch/riscv.inc.mk index 120abb67dd062..9fc5aa4114af0 100644 --- a/makefiles/arch/riscv.inc.mk +++ b/makefiles/arch/riscv.inc.mk @@ -1,5 +1,16 @@ # Target architecture for the build. -TARGET_ARCH ?= riscv-none-embed +TARGET_ARCH ?= riscv-none-elf + +# If TARGET_ARCH wasn't set by user, fall back to legacy riscv-none-embed +# triplet if ricsv-none-elf is missing but riscv-none-embed is present +ifeq (riscv-none-elf,$(TARGET_ARCH)) + ifeq (,$(shell which $(TARGET_ARCH)-gcc)) + ifneq (,$(shell which riscv-none-embed-gcc)) + $(info Falling back to legacy riscv-none-embed toolchain) + TARGET_ARCH := riscv-none-embed + endif + endif +endif # define build specific options CFLAGS_CPU = -march=rv32imac -mabi=ilp32 -mcmodel=medlow -msmall-data-limit=8