CMakeLists.txt: Link libkernel.a as whole-archive, like everything else #16021
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a report that a non-trivial application (MicroPython with
experimental LVGL bindings) errors out at link stage:
ld: libmicropython.a(main.o): in function
k_timer_start': zephyr/include/generated/syscalls/kernel.h:55: undefined reference toz_impl_k_timer_start'ld: libmicropython.a(main.o):(._k_timer.static.lvgl_timer+0xc):
undefined reference to `z_timer_expiration_handler'
These functions are of course defined and available in libkernel.a.
Investigating the link command, turned out that while all other
Zephyr constituent libraries are linked with --whole-archive flag,
libkernel.a isn't. Changing that fixed the issue above. Given that
it is in no way special than any other build process constituent
libs (the only difference is that it's always present, while presence
of other libs depends on configuration), this appears to be a
change which make sense.
Signed-off-by: Paul Sokolovsky [email protected]