Skip to content

Commit

Permalink
Kconfig LTO: Prevent with native simulator based targets
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
  • Loading branch information
aescolar authored and henrikbrixandersen committed Feb 8, 2024
1 parent 04156bc commit 40b53d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Kconfig.zephyr
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 40b53d5

Please sign in to comment.