From 14509a8d7beb5f8a1995ece0b3c015d919e8fa44 Mon Sep 17 00:00:00 2001 From: Luca Burelli Date: Thu, 11 Apr 2024 09:05:20 +0200 Subject: [PATCH] cmake: add_llext_target: use toolchain-specific partial linking option The partial linking option depends on the linker used in the build process, and this flag is already defined by the Zephyr toolchains. Use the $ generator expression to retrieve it instead of hardcoding the value for the GNU linker. Signed-off-by: Luca Burelli --- cmake/modules/extensions.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/modules/extensions.cmake b/cmake/modules/extensions.cmake index 508964bd815..35fa6b3a0f8 100644 --- a/cmake/modules/extensions.cmake +++ b/cmake/modules/extensions.cmake @@ -5328,7 +5328,8 @@ function(add_llext_target target_name) # output a relocatable file. The output file suffix is changed so # the result looks like the object file it actually is. add_executable(${llext_lib_target} EXCLUDE_FROM_ALL ${source_files}) - target_link_options(${llext_lib_target} PRIVATE -r) + target_link_options(${llext_lib_target} PRIVATE + $) set_target_properties(${llext_lib_target} PROPERTIES SUFFIX ${CMAKE_C_OUTPUT_EXTENSION}) set(llext_lib_output $)