This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 155517b5fc arch/sim/src/cmake/Toolchain.cmake: macOS fix unknown 
options: --gc-sections
155517b5fc is described below

commit 155517b5fc8c69da94767ed62b686a46edc19817
Author: simbit18 <[email protected]>
AuthorDate: Mon Aug 12 13:39:50 2024 +0200

    arch/sim/src/cmake/Toolchain.cmake: macOS fix unknown options: --gc-sections
    
    fix
    ld: unknown options: --gc-sections
    
    added -> add_link_options(-Wl,-dead_strip)
---
 arch/sim/src/cmake/Toolchain.cmake | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/sim/src/cmake/Toolchain.cmake 
b/arch/sim/src/cmake/Toolchain.cmake
index c1caedd3c6..7fb1989fcf 100644
--- a/arch/sim/src/cmake/Toolchain.cmake
+++ b/arch/sim/src/cmake/Toolchain.cmake
@@ -97,7 +97,11 @@ else()
 endif()
 
 if(CONFIG_DEBUG_OPT_UNUSED_SECTIONS)
-  add_link_options(-Wl,--gc-sections)
+  if(APPLE)
+    add_link_options(-Wl,-dead_strip)
+  else()
+    add_link_options(-Wl,--gc-sections)
+  endif()
   add_compile_options(-ffunction-sections -fdata-sections)
 endif()
 

Reply via email to