You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "xuxin930 (via GitHub)" <gi...@apache.org> on 2024/04/01 02:27:48 UTC

Re: [PR] cmake:fix protected build link option break,init canmv230 protected build [nuttx]

xuxin930 commented on code in PR #12022:
URL: https://github.com/apache/nuttx/pull/12022#discussion_r1545901319


##########
CMakeLists.txt:
##########
@@ -758,8 +758,14 @@ if(CONFIG_BUILD_PROTECTED)
     OUTPUT_VARIABLE nuttx_user_libgcc)
 
   # reset link options for userspace to prevent sections from being accidentally
-  # deleted
-  set_target_properties(nuttx_user PROPERTIES LINK_OPTIONS "")
+  # deleted Toolchain link options
+  get_target_property(nuttx_user_LINK_OPTIONS nuttx_user LINK_OPTIONS)
+  list(REMOVE_ITEM nuttx_user_LINK_OPTIONS "-Wl,--gc-sections")

Review Comment:
   > why not skip adding these option instead
   
   These link options is set in the Toolchain file and has global scope.
   they are also required by the nuttx target.but the timing of setting the Toolchain file is before all targets.
   so it cannot be distinguished by USER_LINK_OPTION and NUTTX_LINK_OPTION like Makefile.
   
   



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