From c79628308f3dbe8352a684a02cb2bc557404a539 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Thu, 6 Jun 2024 15:20:10 +0200 Subject: [PATCH] llext: don't build if CONFIG_LLEXT=n Not all configurations need LLEXT, don't include LLEXT support in such cases. Signed-off-by: Guennadi Liakhovetski --- src/include/sof/llext_manager.h | 6 ++++++ src/library_manager/lib_manager.c | 2 ++ zephyr/CMakeLists.txt | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/include/sof/llext_manager.h b/src/include/sof/llext_manager.h index d75dae4b4..55ca48d31 100644 --- a/src/include/sof/llext_manager.h +++ b/src/include/sof/llext_manager.h @@ -11,10 +11,16 @@ struct comp_driver; struct comp_ipc_config; +#if CONFIG_LLEXT uintptr_t llext_manager_allocate_module(struct processing_module *proc, const struct comp_ipc_config *ipc_config, const void *ipc_specific_config); int llext_manager_free_module(const uint32_t component_id); +#else +#define llext_manager_allocate_module(proc, ipc_config, ipc_specific_config) 0 +#define llext_manager_free_module(component_id) 0 +#define llext_unload(ext) 0 +#endif #endif diff --git a/src/library_manager/lib_manager.c b/src/library_manager/lib_manager.c index 9c4f071d0..e7007517c 100644 --- a/src/library_manager/lib_manager.c +++ b/src/library_manager/lib_manager.c @@ -29,7 +29,9 @@ #include #include +#if CONFIG_LLEXT #include +#endif #if CONFIG_LIBRARY_AUTH_SUPPORT #include diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index ac7f011e2..968401247 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -648,7 +648,7 @@ zephyr_library_sources_ifdef(CONFIG_LIBRARY_MANAGER ${SOF_SRC_PATH}/library_manager/lib_notification.c ) -if (CONFIG_MM_DRV) +if (CONFIG_MM_DRV AND CONFIG_LLEXT) zephyr_library_sources_ifdef(CONFIG_LIBRARY_MANAGER ${SOF_SRC_PATH}/library_manager/llext_manager.c )