You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* [Zephyr] Fix sys_heap malloc build with LTO
Fix the build of Matter samples with sys_heap malloc enabled.
The linker errors would occur because:
1. The realloc() function is not used outside the LTO-
optimized code.
2. Thus, the LTO linker plugin would mark __wrap_realloc
symbol as PREVAILING_DEF_IRONLY, which would enable
the compiler to optimize away the function.
3. As a result, undefined references to realloc() could not
be resolved by the linker.
Mark malloc/calloc/realloc/free as externally visible.
Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
* [nrfconnect] Do not link libCHIPShell.a with --whole-archive
libCHIPShell.a is already part of libCHIP.a but the former
had to be linked additionally with --whole-archive flag to
process the shell and init objects defined with SHELL_XXX
and SYS_INIT Zephyr macros and, in turn, register Matter
shell commands properly.
This symbol duplication between the two libraries causes
issues when building Matter with LTO, so replace the current
approach with explicitly pulling in one symbol from
MainLoopZephyr.cpp file.
Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
* [nrfconnect] Build all clusters app for nRF7002 with LTO
The flash usage on this app/platform is close to the limit.
Enable LTO to prevent from blocking the incoming PRs.
Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
---------
Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
0 commit comments