From 96a90550c48619d07eec8ba57fdd331148a21018 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Mon, 24 Apr 2023 14:58:18 -0500 Subject: [PATCH] kernel: idle: fix build error on arm-clang When building sample.minimal.mt-no-preempt-no-timers.arm on arm-clang we get a link error as z_pm_save_idle_exit expects sys_clock_idle_exit to be defined. However the sample sets CONFIG_SYS_CLOCK_EXISTS=n so sys_clock_idle_exit() will not be defined by any driver. So add proper ifdef protection in z_pm_save_idle_exit to fix this. Signed-off-by: Kumar Gala --- kernel/idle.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/idle.c b/kernel/idle.c index 75cf75242d7..2ad33693644 100644 --- a/kernel/idle.c +++ b/kernel/idle.c @@ -27,7 +27,9 @@ void z_pm_save_idle_exit(void) */ pm_system_resume(); #endif /* CONFIG_PM */ +#ifdef CONFIG_SYS_CLOCK_EXISTS sys_clock_idle_exit(); +#endif } void idle(void *unused1, void *unused2, void *unused3)