pkarashchenko commented on code in PR #14130:
URL: https://github.com/apache/nuttx/pull/14130#discussion_r1803780376


##########
arch/arm64/src/cmake/Toolchain.cmake:
##########
@@ -190,5 +190,14 @@ if(CONFIG_DEBUG_SYMBOLS)
 endif()
 
 if(CONFIG_ARCH_TOOLCHAIN_GNU)
-  add_link_options(-Wl,--no-warn-rwx-segments)
+  if(NOT GCCVER)
+    execute_process(COMMAND ${CMAKE_C_COMPILER} --version
+                    OUTPUT_VARIABLE GCC_VERSION_INFO)
+    string(REGEX MATCH "[0-9]+\\.[0-9]+" GCC_VERSION ${GCC_VERSION_INFO})
+    string(REGEX REPLACE "\\..*" "" GCCVER ${GCC_VERSION})
+    set(GCCVER ${CMAKE_MATCH_1})
+  endif()
+  if(GCCVER GREATER_EQUAL 12)

Review Comment:
   Just an idea: maybe CMake can use native way of checking? Like `if 
(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0)` or something like this. 
I'm not sure if we may need additional check for GCC toolchain or not.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to