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 <raiden00@railab.me>
Assisted-by: Claude Code
This commit is contained in:
raiden00pl 2026-08-04 18:38:51 +02:00 committed by Xiang Xiao
parent e13fb3d8c1
commit 3e142bbced

View file

@ -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>")