zephyr/cmake/linker/ld
Ederson de Souza 321e395a8f linker: Include libkernel.a in the whole-archive when llext is enabled
Differently from other libraries, which are included whole in the final
Zephyr ELF, libkernel.a itself isn't. Assuming this is intended to
enable optimisations (if it isn't, this patch will break things) - linker
can remove parts of the kernel that are not used by the application.

However, when considering Linkable Loadable Extensions (llext), this
optimisations can be counterproductive: for instance, syscalls that are
not used by the application won't be available for extensions. It won't
matter if someone "EXPORT_SYMBOL" for them, or even try to keep them
using LINKER_KEEP, they'll be gone.

To avoid that, this patches includes, when CONFIG_LLEXT=y, libkernel.a
inside the linker "whole-archive" block. This ends up making it consider
libkernel.a as a library whose all symbols should be kept. Note this
doesn't mean that all symbols will be there - things compiled out via
Kconfig will naturally still be out.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-03-26 19:31:56 -04:00
..
clang cmake/toolchain: Support LLVM source profiling/coverage for native boards 2023-08-28 10:35:21 +02:00
gcc toolchain: Move extra warning options to toolchain abstraction 2023-02-19 20:34:13 -05:00
host-gcc toolchain: improved toolchain abstraction for compilers and linker 2020-09-04 20:36:59 +02:00
ld_script.cmake cmake: Update cmake_minimum_required to 3.20.0 2022-07-04 10:18:45 +02:00
linker_flags.cmake buildsystem: Add an option to enable LTO 2024-02-02 19:49:36 +01:00
target.cmake linker: Include libkernel.a in the whole-archive when llext is enabled 2024-03-26 19:31:56 -04:00
target_baremetal.cmake build: Fix native_posix build on GNU GCC 2021-10-05 05:44:32 -04:00
target_base.cmake llvm: Add support for selecting runtime library 2023-08-03 19:35:11 +02:00
target_configure.cmake include: Prefix includes to use a scope 2022-04-08 19:03:32 +02:00
target_cpp.cmake libc: picolibc: Fix picolibc to allow third party CPP 2023-10-09 15:05:39 +03:00
target_relocation.cmake cmake: code_relocation: Re-run when relocation_dict.txt changes 2024-01-15 13:20:17 +01:00