You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "no1wudi (via GitHub)" <gi...@apache.org> on 2023/06/15 06:12:04 UTC

[GitHub] [nuttx] no1wudi commented on a diff in pull request #9537: riscv: Add zicsr/zifencei flags for GCC 12

no1wudi commented on code in PR #9537:
URL: https://github.com/apache/nuttx/pull/9537#discussion_r1230481764


##########
arch/risc-v/src/common/Toolchain.defs:
##########
@@ -118,14 +118,28 @@ endif
 
 # Generic GNU RVG toolchain
 
-ifeq ($(CONFIG_RISCV_TOOLCHAIN),GNU_RVG)
+ifeq ($(CONFIG_RISCV_TOOLCHAIN_GNU_RV32),y)
+  CROSSDEV ?= riscv32-unknown-elf-
+else
+  CROSSDEV ?= riscv64-unknown-elf-
+endif
 
-  # Generic GNU RVG toolchain
+# Default toolchain
 
-  ifeq ($(CONFIG_RISCV_TOOLCHAIN_GNU_RV32),y)
-    CROSSDEV ?= riscv32-unknown-elf-
-  else
-    CROSSDEV ?= riscv64-unknown-elf-
+CC      = $(CROSSDEV)gcc
+CXX     = $(CROSSDEV)g++
+CPP     = $(CROSSDEV)gcc -E -P -x c
+STRIP   = $(CROSSDEV)strip --strip-unneeded
+OBJCOPY = $(CROSSDEV)objcopy
+OBJDUMP = $(CROSSDEV)objdump
+LD      = $(CROSSDEV)ld
+AR      = $(CROSSDEV)ar rcs
+NM      = $(CROSSDEV)nm
+
+ifeq ($(CONFIG_RISCV_TOOLCHAIN),GNU_RVG)
+
+  ifeq ($(GCCVER),)
+    export GCCVER := $(shell $(CC) --version | grep gcc | sed -r "s/.* ([0-9]+\.[0-9]+).*/\1/")

Review Comment:
   How about provide `CC_VERSION` in each Toolchain.defs ?



-- 
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