From 3e142bbced97d1c99663354d2eca6f6db1f83d51 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Tue, 4 Aug 2026 18:38:51 +0200 Subject: [PATCH] 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 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 " rcs ") set(CMAKE_RANLIB_COMMAND " ")