Skip to content

Commit

Permalink
llext: check a Kconfig option to select ld flags
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
lyakh authored and kv2019i committed Jun 4, 2024
1 parent 908d69c commit 0bda13d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0bda13d

Please sign in to comment.