Skip to content

Commit 0bda13d

Browse files
lyakhkv2019i
authored andcommitted
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 908d69c commit 0bda13d

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
@@ -80,10 +80,10 @@ function(sof_llext_build module)
8080
-o rimage_config.toml
8181
)
8282

83-
if("${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "zephyr")
84-
set(EXTRA_LINKER_PARAMS -nostdlib -nodefaultlibs -shared)
85-
else()
83+
if(CONFIG_LLEXT_TYPE_ELF_RELOCATABLE)
8684
set(EXTRA_LINKER_PARAMS -nostdlib -nodefaultlibs -r)
85+
else()
86+
set(EXTRA_LINKER_PARAMS -nostdlib -nodefaultlibs -shared)
8787
endif()
8888

8989
get_target_property(proc_in_file ${module} lib_output)

0 commit comments

Comments
 (0)