From 61cdcb33839c3177db528a0869532b639819aea4 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Fri, 6 Jun 2025 10:53:21 +0200 Subject: [PATCH] kernel: Guard SYS_CLOCK_HW_CYCLES_PER_SEC to avoid spurious empty macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If SYS_CLOCK_EXISTS is not enabled, then the SYS_CLOCK_HW_CYCLES_PER_SEC still gets created, but with no value. This causes the code generation in misc/generated/CMakeLists.txt to create an empty assembly macro: `.equ  CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC,` which then causes a build error. Disable SYS_CLOCK_HW_CYCLES_PER_SEC entirely when SYS_CLOCK_EXISTS is disabled to fix this. This is a follow-up to 03f46db8591e191eaf8744ab36f8401aac102def. Signed-off-by: Carles Cufi --- kernel/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/Kconfig b/kernel/Kconfig index 5bf5c2fb22b..fb0ebfd11ac 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -844,6 +844,7 @@ config SYS_CLOCK_TICKS_PER_SEC config SYS_CLOCK_HW_CYCLES_PER_SEC int "System clock's h/w timer frequency" default 0 if TIMER_READS_ITS_FREQUENCY_AT_RUNTIME + depends on SYS_CLOCK_EXISTS help This option specifies the frequency of the hardware timer used for the system clock (in Hz). This option is set by the SOC's or board's Kconfig file