zephyr/lib
Torsten Rasmussen 2e3873adde cmake: improve Zephyr link phase
Zephyr is a bare metal build where standard libs are disabled.

This means that c and runtime libraries must manually be linked in.

This has generally been handled by using CMake's link libraries handling
but the issue with that is both de-duplication but also library link
order.

Standard libraries must be linked at last location to ensure symbols
are always available, however this is not optimal with
target_link_libraries() because this would ultimately require every
library to know the c library to link with, which is not desired.

Therefore, setup standard C and runtime library linking in linker
CMake files for toolchains where this is required.

This commit expands the principle introduced with toolchain abstraction,
see PR#24851.

This means that a toolchain implementation may specify standard C,
runtime, C++, etc libraries, as well as their link order.
Because a property approach is used, then Zephyr modules, such as the
Picolibc module can adjust such properties.

An optional `zephyr_linker_finalize()` macro is called at the end of
Zephyr's CMakeList process and can be used by the toolchain
implementation to define the final linker invocation.

This aligns the linker handling flow to the principle introduced in
PR#24851 and improves the flexibility and robustness of Zephyr build
system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-10-04 16:34:35 +01:00
..
acpi
cpp lib c/cpp: Move .ctor .init_array handling from C++ to kernel 2024-06-25 19:14:37 -04:00
crc style: lib: crc: comply with MISRA C:2012 Rule 15.6 2024-08-20 10:33:51 +02:00
hash
heap lib: added blanks between operators 2024-06-13 20:28:23 -04:00
libc cmake: improve Zephyr link phase 2024-10-04 16:34:35 +01:00
mem_blocks
net_buf lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
open-amp driver: ram_console: leave one byte from the defined buffer size 2024-06-12 17:09:24 -05:00
os arch: kernel: lib: toolchain: Standardize TLS keyword 2024-09-23 10:01:48 +02:00
posix posix: use sys_sem instead of k_spinlock for pool synch 2024-10-03 17:07:05 +01:00
runtime
smf lib: smf: use while (true) in get_child_of for better clarity 2024-07-01 16:08:05 -04:00
utils sys: timeutil: expose and use macro for base year 2024-08-29 11:38:28 +02:00
CMakeLists.txt lib: net_buf: move the network buffer implementation to lib 2024-09-07 11:19:05 -05:00
Kconfig lib: net_buf: move the network buffer implementation to lib 2024-09-07 11:19:05 -05:00