zephyr/lib/utils/CMakeLists.txt
Torsten Rasmussen c79c4ef9a8 linker: move last section id constant to c-code
Move creation of last section id from ld linker script LONG() usage to
C code with last section attribute.

The use of `LONG()` works correctly with ld but lld emits a warning
because .last_section section is not allocated as there are no matching
input sections and discards the `LONG()` call, meaning the last section
identifier will not be present in the flash.
> ld.lld: warning: ignoring memory region assignment for
>                             non-allocatable section '.last_section'

Placing the last section id in `.last_section` in C code makes lld
allocate the memory for the id and thereby create the output section
with the correct output.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2025-05-08 15:55:40 +02:00

33 lines
666 B
CMake

# SPDX-License-Identifier: Apache-2.0
zephyr_sources_ifdef(CONFIG_BASE64 base64.c)
zephyr_sources(
dec.c
hex.c
rb.c
timeutil.c
bitarray.c
)
zephyr_sources_ifdef(CONFIG_ONOFF onoff.c)
zephyr_sources_ifdef(CONFIG_NOTIFY notify.c)
zephyr_sources_ifdef(CONFIG_JSON_LIBRARY json.c)
zephyr_sources_ifdef(CONFIG_RING_BUFFER ring_buffer.c)
zephyr_sources_ifdef(CONFIG_UTF8 utf8.c)
zephyr_sources_ifdef(CONFIG_WINSTREAM winstream.c)
zephyr_sources_ifdef(CONFIG_COBS cobs.c)
zephyr_library_include_directories(
${ZEPHYR_BASE}/kernel/include
${ZEPHYR_BASE}/arch/${ARCH}/include
)
zephyr_sources_ifdef(CONFIG_LINKER_LAST_SECTION_ID last_section_id.c)