You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/12/27 06:57:47 UTC
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5076: arch/risc-v: Refine Toolchain.defs
xiaoxiang781216 commented on a change in pull request #5076:
URL: https://github.com/apache/incubator-nuttx/pull/5076#discussion_r775358856
##########
File path: arch/risc-v/src/common/Toolchain.defs
##########
@@ -53,15 +53,66 @@ else
MAXOPTIMIZATION ?= -Os
endif
-# Generic GNU RVG toolchain
ifeq ($(CONFIG_RISCV_TOOLCHAIN),GNU_RVG)
+
+ # Generic GNU RVG toolchain
+
CROSSDEV ?= riscv64-unknown-elf-
+
+ # Detect cpu ISA support flags
+
+ ifeq ($(CONFIG_ARCH_RV_ISA_M),y)
+ ARCHRVISAM = m
+ endif
+
+ ifeq ($(CONFIG_ARCH_RV_ISA_A),y)
+ ARCHRVISAA = a
+ endif
+
+ ifeq ($(CONFIG_ARCH_RV_ISA_C),y)
+ ARCHRVISAC = c
+ endif
+
ifeq ($(CONFIG_ARCH_FPU),y)
- ARCHCPUFLAGS = -march=rv32imfc -mabi=ilp32f
+
+ ifeq ($(CONFIG_ARCH_RV_ISA_F),y)
+ ARCHRVISAF = f
+ endif
+
+ ifeq ($(CONFIG_ARCH_DPFPU),y)
+
+ ifeq ($(CONFIG_ARCH_RV_ISA_D),y)
+ ARCHRVISAD = d
+ endif
+
+ endif
+ endif
+
+ # Detect abi type
+
+ ifeq ($(CONFIG_ARCH_RV32),y)
+ ARCHTYPE = rv32
+ ARCHABITYPE = ilp32
+ else ifeq ($(CONFIG_ARCH_RV64),y)
+ ARCHTYPE = rv64
+ ARCHABITYPE = lp64
+ endif
+
+ # Construct arch flags
+
+ ARCHCPUFLAGS = -march=$(ARCHTYPE)i$(ARCHRVISAM)$(ARCHRVISAA)$(ARCHRVISAF)$(ARCHRVISAD)$(ARCHRVISAC)
+
+ # Construct arch abi flags
+
+ ifeq ($(CONFIG_ARCH_DPFPU),y)
Review comment:
why not define ARCHRVISAD correctly at line 83
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org