mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-01 13:18:36 -09:00
Adds a new user-configurable string to arch/Config.in.riscv, and in arch/arch.mk.riscv appends it to GCC_TARGET_ARCH. This enables custom extensions/combinations to be easily configured. Signed-off-by: Charlie Jenkins <charlie@rivosinc.com> Reviewed-by: Jesse Taube <Mr.Bossman075@gmail.com> [Arnout: - fix check-package warnings - introduce ARCH_RISV_ISA_EXTRA to simplify stripping of quotes ] Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
48 lines
1.2 KiB
Plaintext
48 lines
1.2 KiB
Plaintext
#
|
|
# Configure the GCC_TARGET_ARCH variable and append the
|
|
# appropriate RISC-V ISA extensions.
|
|
#
|
|
|
|
ifeq ($(BR2_riscv),y)
|
|
|
|
ifeq ($(BR2_RISCV_64),y)
|
|
GCC_TARGET_ARCH := rv64i
|
|
else
|
|
GCC_TARGET_ARCH := rv32i
|
|
endif
|
|
|
|
ifeq ($(BR2_RISCV_ISA_RVM),y)
|
|
GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)m
|
|
endif
|
|
ifeq ($(BR2_RISCV_ISA_RVA),y)
|
|
GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)a
|
|
endif
|
|
ifeq ($(BR2_RISCV_ISA_RVF),y)
|
|
GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)f
|
|
endif
|
|
ifeq ($(BR2_RISCV_ISA_RVD),y)
|
|
GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)d
|
|
endif
|
|
ifeq ($(BR2_RISCV_ISA_RVC),y)
|
|
GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)c
|
|
endif
|
|
ifeq ($(BR2_RISCV_ISA_RVV),y)
|
|
GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)v
|
|
endif
|
|
|
|
# Starting from gcc 12.x, csr and fence instructions have been
|
|
# separated from the base I instruction set, and special -march
|
|
# suffixes are needed to enable their support. In Buildroot, we assume
|
|
# all RISC-V cores that support Linux implement those instructions, so
|
|
# we unconditionally enable those extensions.
|
|
ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_12),y)
|
|
GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)_zicsr_zifencei
|
|
endif
|
|
|
|
ARCH_RISV_ISA_EXTRA = $(call qstrip, $(BR2_RISCV_ISA_EXTRA))
|
|
ifneq ($(ARCH_RISV_ISA_EXTRA),)
|
|
GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)_$(ARCH_RISV_ISA_EXTRA)
|
|
endif
|
|
|
|
endif
|