llext: automatically select LLEXT type

When using a clang Cadence toolchain to build SOF and LLEXT modules
we need to select a different LLEXT type than when using a Zephyr gcc
toolchain.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2024-05-22 10:21:09 +02:00 committed by Kai Vehmanen
parent 013e210209
commit 799f8279f7
2 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1 @@
CONFIG_LLEXT_TYPE_ELF_RELOCATABLE=y

View File

@ -812,6 +812,12 @@ def build_platforms():
if args.debug:
overlays.append(str(pathlib.Path(SOF_TOP, "app", "debug_overlay.conf")))
# The xt-cland Cadence toolchain currently cannot link shared
# libraries for Xtensa. Therefore when it's used we switch to
# building relocatable ELF objects.
if platf_build_environ.get("ZEPHYR_TOOLCHAIN_VARIANT") == 'xt-clang':
overlays.append(str(pathlib.Path(SOF_TOP, "app", "llext_relocatable.conf")))
if overlays:
overlays = ";".join(overlays)
build_cmd.append(f"-DOVERLAY_CONFIG={overlays}")