yf13 commented on code in PR #11579:
URL: https://github.com/apache/nuttx/pull/11579#discussion_r1461818193


##########
arch/risc-v/src/cmake/Toolchain.cmake:
##########
@@ -273,19 +273,24 @@ if(${CONFIG_RISCV_TOOLCHAIN} STREQUAL GNU_RVG)
 
   set(PLATFORM_FLAGS)
 
-  if(CONFIG_ARCH_RV32)
-    if(${ARCHCPUEXTFLAGS} STREQUAL imc)
-      list(APPEND PLATFORM_FLAGS -mcpu=sifive-e20)
-    elseif(${ARCHCPUEXTFLAGS} STREQUAL imac)
-      list(APPEND PLATFORM_FLAGS -mcpu=sifive-e31)
-    elseif(${ARCHCPUEXTFLAGS} STREQUAL imafc)
-      list(APPEND PLATFORM_FLAGS -mcpu=sifive-e76)
-    endif()
-  else()
-    if(${ARCHCPUEXTFLAGS} STREQUAL imac)
-      list(APPEND PLATFORM_FLAGS -mcpu=sifive-s51)
-    elseif(${ARCHCPUEXTFLAGS} STREQUAL imafdc)
-      list(APPEND PLATFORM_FLAGS -mcpu=sifive-u54)
+  # Ubuntu gcc-riscv64-unknown-elf complains about options below so only use
+  # them for higher version toolchain
+
+  if(GCC_VERSION GREATER_EQUAL 12)
+    if(CONFIG_ARCH_RV32)
+      if(${ARCHCPUEXTFLAGS} STREQUAL imc)
+        list(APPEND PLATFORM_FLAGS -mcpu=sifive-e20)

Review Comment:
   @anchao sorry for late response, I was away.
   
   Did you mean that we only replace PLATFORM_FLAGS with LLVM_CPUTYPE  in 
Toolchains.cmake and no need for the change in platform.cmake?
   
   I will give it a test here locally, if you share how to use Clang, I can 
also give Clang  a check. 



-- 
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-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to