Skip to content

Commit

Permalink
build system: use riscv-none-elf as triplet
Browse files Browse the repository at this point in the history
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 but
riscv-none-embed is, fall back to legacy triplet (and print an info message
about this behavior).
  • Loading branch information
maribu committed Sep 7, 2020
1 parent b353733 commit f946006
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions dist/tools/ci/print_toolchain_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
13 changes: 12 additions & 1 deletion makefiles/arch/riscv.inc.mk
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit f946006

Please sign in to comment.