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


##########
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:
   ```suggestion
           list(APPEND LLVM_CPUTYPE -mcpu=sifive-e20)
   ```



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