build system: use riscv-none-elf as triplet

Use riscv-none-elf instead of legacy riscv-none-embed as target triplet for
RISC-V development. However, if ricsv-none-elf is not present, try
riscv64-unknown-elf and riscv-none-embed instead. If the legacy riscv-none-embed
is used, a warning is printed.
This commit is contained in:
Marian Buschsieweke 2020-09-07 22:21:42 +02:00
parent a301e81b47
commit d9e495fe83
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F
2 changed files with 19 additions and 1 deletions

View File

@ -126,6 +126,8 @@ for p in \
arm-none-eabi \ arm-none-eabi \
avr mips-mti-elf \ avr mips-mti-elf \
msp430-elf \ msp430-elf \
riscv-none-elf \
riscv64-unknown-elf \
riscv-none-embed \ riscv-none-embed \
xtensa-esp32-elf \ xtensa-esp32-elf \
xtensa-esp8266-elf \ xtensa-esp8266-elf \
@ -141,6 +143,8 @@ for p in \
arm-none-eabi \ arm-none-eabi \
mips-mti-elf \ mips-mti-elf \
msp430-elf \ msp430-elf \
riscv-none-elf \
riscv64-unknown-elf \
riscv-none-embed \ riscv-none-embed \
xtensa-esp32-elf \ xtensa-esp32-elf \
xtensa-esp8266-elf \ xtensa-esp8266-elf \

View File

@ -1,5 +1,19 @@
# Target architecture for the build. # Target architecture for the build.
TARGET_ARCH_RISCV ?= riscv-none-embed TARGET_ARCH_RISCV ?= riscv-none-elf
# If TARGET_ARCH wasn't set by user, also check if riscv64-unknown-elf
# or riscv-none-embed is present.
ifeq (riscv-none-elf,$(TARGET_ARCH_RISCV))
ifeq (,$(shell which $(TARGET_ARCH_RISCV)-gcc))
ifneq (,$(shell which riscv64-unknown-elf-gcc))
TARGET_ARCH_RISCV := riscv64-unknown-elf
else ifneq (,$(shell which riscv-none-embed-gcc))
$(info Falling back to legacy riscv-none-embed toolchain)
TARGET_ARCH_RISCV := riscv-none-embed
endif
endif
endif
TARGET_ARCH ?= $(TARGET_ARCH_RISCV) TARGET_ARCH ?= $(TARGET_ARCH_RISCV)
# define build specific options # define build specific options