]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
lto.inc: introduce LTO_DEFAULT variable to support per-package overrides with Clang
authormark.yang <mark.yang@lge.com>
Fri, 30 Jan 2026 09:54:52 +0000 (18:54 +0900)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 9 Feb 2026 17:46:58 +0000 (17:46 +0000)
commitcc90f8c3b9aaa25307959a091076b78cd58ea142
treec56f52804a98849faf0bedf6d00505b002ae2156
parentf223bd675af1707242f18a0a086f63f4088b4e99
lto.inc: introduce LTO_DEFAULT variable to support per-package overrides with Clang

Currently, LTO variable is set with a toolchain-clang override directly.

This causes priority issues where package-specific overrides (e.g., LTO:pn-perl = "")
are ignored when the Clang toolchain is active, making it difficult to disable LTO
for specific failing recipes.

This patch refactors the logic by introducing an intermediate `LTO_DEFAULT` variable.
- `LTO_DEFAULT` handles the toolchain-specific flags (GCC vs Clang).
- `LTO` is assigned `LTO_DEFAULT` as a default value.

This structure allows `LTO` to be cleanly overridden by recipe-specific overrides
(like `pn-${PN}`) regardless of the active toolchain.

Added a toolchain-gcc override for alsa-lib because -flto-partition=none is not
supported by Clang.

Signed-off-by: mark.yang <mark.yang@lge.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/distro/include/lto.inc