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 <reto.schneider@husqvarnagroup.com>
This commit is contained in:
Reto Schneider 2024-03-19 12:22:48 +01:00 committed by Anas Nashif
parent d89e7f63fd
commit 75a3805c8b

View file

@ -429,7 +429,9 @@ endchoice
config LTO config LTO
bool "Link Time Optimization [EXPERIMENTAL]" 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 select EXPERIMENTAL
help help
This option enables Link Time Optimization. This option enables Link Time Optimization.