diff --git a/tests/subsys/llext/simple/CMakeLists.txt b/tests/subsys/llext/simple/CMakeLists.txt index 4a9f311d8fa..87a71554ba4 100644 --- a/tests/subsys/llext/simple/CMakeLists.txt +++ b/tests/subsys/llext/simple/CMakeLists.txt @@ -15,6 +15,7 @@ target_include_directories(app PRIVATE ${ZEPHYR_BASE}/arch/${ARCH}/include ) +if(NOT LOADER_BUILD_ONLY) # generate extension targets foreach extension given by name foreach(ext_name hello_world logging relative_jump object) set(ext_src ${PROJECT_SOURCE_DIR}/src/${ext_name}_ext.c) @@ -26,3 +27,4 @@ foreach(ext_name hello_world logging relative_jump object) ) generate_inc_file_for_target(app ${ext_bin} ${ext_inc}) endforeach() +endif() diff --git a/tests/subsys/llext/simple/src/test_llext_simple.c b/tests/subsys/llext/simple/src/test_llext_simple.c index dcb31ac9e4a..6f92951dd56 100644 --- a/tests/subsys/llext/simple/src/test_llext_simple.c +++ b/tests/subsys/llext/simple/src/test_llext_simple.c @@ -120,6 +120,8 @@ void load_call_unload(struct llext_test *test_case) llext_unload(&ext); } + +#ifndef LOADER_BUILD_ONLY /* * Attempt to load, list, list symbols, call a fn, and unload each * extension in the test table. This excercises loading, calling into, and @@ -151,6 +153,7 @@ static LLEXT_CONST uint8_t relative_jump_ext[] __aligned(4) = { #include "relative_jump.inc" }; LLEXT_LOAD_UNLOAD(relative_jump, true) +#endif /* ! LOADER_BUILD_ONLY */ static LLEXT_CONST uint8_t object_ext[] __aligned(4) = { #include "object.inc" diff --git a/tests/subsys/llext/simple/testcase.yaml b/tests/subsys/llext/simple/testcase.yaml index bd683e2d3b0..2a90bd1fadb 100644 --- a/tests/subsys/llext/simple/testcase.yaml +++ b/tests/subsys/llext/simple/testcase.yaml @@ -6,7 +6,25 @@ common: platform_exclude: - numaker_pfm_m487 # See #63167 - qemu_cortex_r5 # unsupported relocations + tests: + # add_llext_target() supports a fairly limited number of + # CONFIG_urations. For instance, invoking add_llext_target() + # currently blocks us from compiling subsys/llext/*.c in 64bits mode; + # CMake aborts before even invoking the compiler. + # + # While there is in practice no value in compiling subsys/llext/*.c + # without actually running it to load some extension, let's keep it in + # good shape and ready to be used when add_llext_target() + # limitations get lifted in the future. + llext.simple.loader_build: + build_only: true + # How to override the above and allow ANY arch? + arch_allow: arm arm64 x86 x86_64 xtensa posix + extra_args: + - LOADER_BUILD_ONLY=1 + - EXTRA_CFLAGS=-DLOADER_BUILD_ONLY=1 + llext.simple.readonly: arch_exclude: xtensa # for now filter: not CONFIG_MPU and not CONFIG_MMU and not CONFIG_SOC_SERIES_S32ZE