From 75a3805c8b96914ea867cb9d03aa32d88344a2b6 Mon Sep 17 00:00:00 2001 From: Reto Schneider Date: Tue, 19 Mar 2024 12:22:48 +0100 Subject: [PATCH] kconfig: lto: Disable when data relocation is enabled As per issue #69730, building arch.shared_interrupt.lto and kernel.common.lto for mimxrt685_evk or mimxrt595_evk/mimxrt595s/cm33 is currently broken due to their usage of CONFIG_CODE_DATA_RELOCATION. This commit disables LTO when CODE_DATA_RELOCATION is enabled, allowing PRs with changes in the kernel code to pass the CI check. On the down side, builds affected by this change produce a new warning: > warning: LTO (defined at Kconfig.zephyr:430) was assigned the value > 'y' but got the value 'n'. Check these unsatisfied dependencies: > (!CODE_DATA_RELOCATION) (=n) Signed-off-by: Reto Schneider --- Kconfig.zephyr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index eb4399c297f..b315a0e7aad 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -429,7 +429,9 @@ endchoice config LTO bool "Link Time Optimization [EXPERIMENTAL]" - depends on (!(GEN_ISR_TABLES || GEN_IRQ_VECTOR_TABLE) || ISR_TABLES_LOCAL_DECLARATION) && !NATIVE_LIBRARY + depends on !(GEN_ISR_TABLES || GEN_IRQ_VECTOR_TABLE) || ISR_TABLES_LOCAL_DECLARATION + depends on !NATIVE_LIBRARY + depends on !CODE_DATA_RELOCATION select EXPERIMENTAL help This option enables Link Time Optimization.