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

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

commit 3e142bbced97d1c99663354d2eca6f6db1f83d51
Author: raiden00pl <[email protected]>
AuthorDate: Tue Aug 4 18:38:51 2026 +0200

    arch/x86_64: define CMAKE_LD and CMAKE_STRIP for ELF applications
    
    CMAKE_LD was never set, so application link commands were invalid, and
    CMAKE_STRIP defaulted to plain 'strip', which removes the symbol and
    relocation tables required to load CONFIG_BINFMT_ELF_RELOCATABLE
    binaries. Use the host linker and 'strip --strip-unneeded' as on the
    other architectures.
    
    Signed-off-by: raiden00pl <[email protected]>
    Assisted-by: Claude Code
---
 arch/x86_64/src/cmake/Toolchain.cmake | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/x86_64/src/cmake/Toolchain.cmake 
b/arch/x86_64/src/cmake/Toolchain.cmake
index fdff54ab0bc..e3e551da318 100644
--- a/arch/x86_64/src/cmake/Toolchain.cmake
+++ b/arch/x86_64/src/cmake/Toolchain.cmake
@@ -27,6 +27,12 @@ set(CMAKE_SYSTEM_VERSION 1)
 
 set(ARCH_SUBDIR intel64)
 
+# host toolchain linker and strip, used for standalone ELF applications;
+# --strip-unneeded keeps the symbols required for relocation processing
+# (CONFIG_BINFMT_ELF_RELOCATABLE binaries are loaded from ET_REL objects)
+set(CMAKE_LD ld)
+set(CMAKE_STRIP strip --strip-unneeded)
+
 # override the ARCHIVE command
 set(CMAKE_ARCHIVE_COMMAND "<CMAKE_AR> rcs <TARGET> <LINK_FLAGS> <OBJECTS>")
 set(CMAKE_RANLIB_COMMAND "<CMAKE_RANLIB> <TARGET>")

Reply via email to