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 <guennadi.liakhovetski@linux.intel.com>
  • Loading branch information
lyakh committed May 28, 2024
1 parent 486c9b9 commit 002d353
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 @@ -78,10 +78,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 002d353

Please sign in to comment.