diff --git a/CMakeLists.txt b/CMakeLists.txt index b589ac43159bb4..2fa2d371c4ab8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -906,7 +906,7 @@ foreach(zephyr_lib ${ZEPHYR_LIBS_PROPERTY}) add_dependencies(${zephyr_lib} zephyr_generated_headers) endforeach() -if(CONFIG_LLEXT) +if(CONFIG_KERNEL_WHOLE_ARCHIVE) set(WHOLE_ARCHIVE_LIBS ${ZEPHYR_LIBS_PROPERTY} kernel) else() set(WHOLE_ARCHIVE_LIBS ${ZEPHYR_LIBS_PROPERTY}) diff --git a/kernel/Kconfig b/kernel/Kconfig index af51267edbf1fc..767c04f94fe47c 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -1020,6 +1020,12 @@ config THREAD_LOCAL_STORAGE help This option enables thread local storage (TLS) support in kernel. +config KERNEL_WHOLE_ARCHIVE + bool + help + This option forces every object file in the libkernel.a archive + to be included, rather than searching the archive for required object files. + endmenu rsource "Kconfig.device" diff --git a/subsys/llext/Kconfig b/subsys/llext/Kconfig index c96017c79c9f14..085ef775569591 100644 --- a/subsys/llext/Kconfig +++ b/subsys/llext/Kconfig @@ -4,6 +4,7 @@ menuconfig LLEXT bool "Linkable loadable extensions" select CACHE_MANAGEMENT if DCACHE + select KERNEL_WHOLE_ARCHIVE help Enable the linkable loadable extension subsystem