arch/riscv/Toolchain: add riscv32-unknown-elf selection

- user can use menuconfig to select riscv64-unknown-elf or riscv32-unknown-elf

Signed-off-by: Zhihong Chen <zhihong.chen@hpmicro.com>
This commit is contained in:
Zhihong Chen 2023-03-08 21:05:56 +08:00 committed by Petro Karashchenko
parent 0e018308a3
commit 698f5f3e80
2 changed files with 18 additions and 5 deletions

View File

@ -306,15 +306,22 @@ config ARCH_MPU_HAS_NAPOT
choice choice
prompt "Toolchain Selection" prompt "Toolchain Selection"
default RISCV_TOOLCHAIN_GNU_RVG default RISCV_TOOLCHAIN_GNU_RV64
config RISCV_TOOLCHAIN_GNU_RVG config RISCV_TOOLCHAIN_GNU_RV64
bool "Generic GNU RVG toolchain" bool "Generic GNU RV64 toolchain"
select ARCH_TOOLCHAIN_GNU select ARCH_TOOLCHAIN_GNU
---help--- ---help---
This option should work for any modern GNU toolchain (GCC 5.2 or newer) This option should work for any modern GNU toolchain (GCC 5.2 or newer)
configured for riscv64-unknown-elf. configured for riscv64-unknown-elf.
config RISCV_TOOLCHAIN_GNU_RV32
bool "Generic GNU RV32 toolchain"
select ARCH_TOOLCHAIN_GNU
---help---
This option should work for any modern GNU toolchain (GCC 5.2 or newer)
configured for riscv32-unknown-elf.
endchoice endchoice
config RISCV_SEMIHOSTING_HOSTFS config RISCV_SEMIHOSTING_HOSTFS

View File

@ -27,7 +27,9 @@
# command-line selection. # command-line selection.
# #
ifeq ($(filter y, $(CONFIG_RISCV_TOOLCHAIN_GNU_RVG)),y) ifeq ($(filter y, $(CONFIG_RISCV_TOOLCHAIN_GNU_RV64)),y)
CONFIG_RISCV_TOOLCHAIN ?= GNU_RVG
else ifeq ($(filter y, $(CONFIG_RISCV_TOOLCHAIN_GNU_RV32)),y)
CONFIG_RISCV_TOOLCHAIN ?= GNU_RVG CONFIG_RISCV_TOOLCHAIN ?= GNU_RVG
endif endif
@ -120,7 +122,11 @@ ifeq ($(CONFIG_RISCV_TOOLCHAIN),GNU_RVG)
# Generic GNU RVG toolchain # Generic GNU RVG toolchain
CROSSDEV ?= riscv64-unknown-elf- ifeq ($(CONFIG_RISCV_TOOLCHAIN_GNU_RV32),y)
CROSSDEV ?= riscv32-unknown-elf-
else
CROSSDEV ?= riscv64-unknown-elf-
endif
# Detect cpu ISA support flags # Detect cpu ISA support flags