anchao commented on code in PR #11579: URL: https://github.com/apache/nuttx/pull/11579#discussion_r1461755905
########## arch/risc-v/src/cmake/platform.cmake: ########## @@ -21,8 +21,20 @@ get_directory_property(NUTTX_EXTRA_FLAGS DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_OPTIONS) +# Ubuntu gcc-riscv64-unknown-elf toolchain complains when ${CMAKE_C_FLAGS} used Review Comment: revert ########## 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) Review Comment: a second thought, please just please PLATFORM_FLAGS to LLVM_CPUTYPE, which will solve your issue -- 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