Skip to content

Commit b607067

Browse files
committed
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 <guennadi.liakhovetski@linux.intel.com>
1 parent 95fbead commit b607067

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

zephyr/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ function(sof_llext_build module)
7878
-o rimage_config.toml
7979
)
8080

81-
if("${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "zephyr")
82-
set(EXTRA_LINKER_PARAMS -nostdlib -nodefaultlibs -shared)
83-
else()
81+
if(CONFIG_LLEXT_TYPE_ELF_RELOCATABLE)
8482
set(EXTRA_LINKER_PARAMS -nostdlib -nodefaultlibs -r)
83+
else()
84+
set(EXTRA_LINKER_PARAMS -nostdlib -nodefaultlibs -shared)
8585
endif()
8686

8787
get_target_property(proc_in_file ${module} lib_output)

0 commit comments

Comments
 (0)