From 0bda13d0bdaa953f6d98d759f4e805adfb9fb331 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Wed, 22 May 2024 11:46:14 +0200 Subject: [PATCH] llext: check a Kconfig option to select ld flags When using xt-clang we cannot build shared objects, so we use '-r' to link relocatable objects. But the decision shouldn't be made based on the name of the compiler, but based on the selected LLEXT_BINARY_TYPE option. Signed-off-by: Guennadi Liakhovetski --- zephyr/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 3958e767a0e4..ac7f011e22e6 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -80,10 +80,10 @@ function(sof_llext_build module) -o rimage_config.toml ) - if("${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "zephyr") - set(EXTRA_LINKER_PARAMS -nostdlib -nodefaultlibs -shared) - else() + if(CONFIG_LLEXT_TYPE_ELF_RELOCATABLE) set(EXTRA_LINKER_PARAMS -nostdlib -nodefaultlibs -r) + else() + set(EXTRA_LINKER_PARAMS -nostdlib -nodefaultlibs -shared) endif() get_target_property(proc_in_file ${module} lib_output)