zephyr: add smex_placeholder()

SMEX cannot do empty dictionaries.

This adds 8 bytes of .bss and 32 bytes of .text

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
Marc Herbert 2021-07-12 06:11:05 +00:00 committed by Liam Girdwood
parent f6c71c21d0
commit ca6e3c3bff
1 changed files with 21 additions and 0 deletions

View File

@ -512,8 +512,29 @@ void sys_comp_eq_iir_init(void);
void sys_comp_kpb_init(void);
void sys_comp_smart_amp_init(void);
/* Zephyr redefines log_message() and mtrace_printf() which leaves
* totally empty the .static_log_entries ELF sections for the
* sof-logger. This makes smex fail. Define at least one such section to
* fix the build when sof-logger is not used.
*/
static inline const void *smex_placeholder_f(void)
{
_DECLARE_LOG_ENTRY(LOG_LEVEL_DEBUG,
"placeholder so .static_log.X are not all empty",
_TRACE_INV_CLASS, 0);
return &log_entry;
}
/* Need to actually use the function and export something otherwise the
* compiler optimizes everything away.
*/
const void *_smex_placeholder;
int task_main_start(struct sof *sof)
{
_smex_placeholder = smex_placeholder_f();
int ret;
/* init default audio components */