From 203206cb681cc3d2014e3b8937e6b1d0544852f3 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Wed, 22 May 2024 10:21:09 +0200 Subject: [PATCH] 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 --- app/llext_relocatable.conf | 1 + scripts/xtensa-build-zephyr.py | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 app/llext_relocatable.conf diff --git a/app/llext_relocatable.conf b/app/llext_relocatable.conf new file mode 100644 index 000000000000..76b5339e1bb0 --- /dev/null +++ b/app/llext_relocatable.conf @@ -0,0 +1 @@ +CONFIG_LLEXT_TYPE_ELF_RELOCATABLE=y diff --git a/scripts/xtensa-build-zephyr.py b/scripts/xtensa-build-zephyr.py index 25a469260dc0..c3419a9519fa 100755 --- a/scripts/xtensa-build-zephyr.py +++ b/scripts/xtensa-build-zephyr.py @@ -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}")