From eb2b1e9b1c679e62a446b88132741bc4bbcfbcc5 Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Thu, 8 Feb 2024 11:23:09 +0100 Subject: [PATCH] Kconfig LTO: Prevent with native simulator based targets LTO cannot be really used with the native simulator based targets neither today. When doing a partial link as we do for these targets the linker will complain if we are mixing LTO and non LTO built code, and fall back to only produce non-LTO output. (The link warning will cause twister to fail the test) Today not all inputs to this partial link are built with LTO enabled (offsets.c and the app library are not). Even if they were, the native targets are mostly a test and debugging facility, so optimizations like these are not beneficial in general. Let's just prevent selecting LTO for these targets. (cherry picked from commit 40b53d5d774705d27183aaa1e42f2f322250da10) Original-Signed-off-by: Alberto Escolar Piedras GitOrigin-RevId: 40b53d5d774705d27183aaa1e42f2f322250da10 Change-Id: Id2cad3164aaac700de6d1b9b63bc3dede9ebff93 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5281899 Reviewed-by: Al Semjonovs Tested-by: Al Semjonovs Tested-by: ChromeOS Prod (Robot) Commit-Queue: Al Semjonovs --- Kconfig.zephyr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 829deac2a9c..5ad2fb2bf85 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -430,7 +430,7 @@ endchoice config LTO bool "Link Time Optimization [EXPERIMENTAL]" - depends on !(GEN_ISR_TABLES || GEN_IRQ_VECTOR_TABLE) || ISR_TABLES_LOCAL_DECLARATION + depends on (!(GEN_ISR_TABLES || GEN_IRQ_VECTOR_TABLE) || ISR_TABLES_LOCAL_DECLARATION) && !NATIVE_LIBRARY select EXPERIMENTAL help This option enables Link Time Optimization.