On Wed, Mar 25, 2026 at 07:39:51AM -0400, Patrick Williams wrote:
> When LTO is enabled, due to a gcc bug[1], the linker needs the same
> flags in DEBUG_PREFIX_MAP as the compiler.  Without this the buildpaths
> QA failure can occur due to unstripped build directory strings in the
> DWARF data.
> 
> With GCC 15.2 this can be noticed by setting many meson-built packages,
> such as systemd, with:
> 
>     EXTRA_OEMESON:append:class-target = " -Db_lto=true"
> 
> Add the DEBUG_PREFIX_MAP to the TARGET_LDFLAGS for gcc.
> 
> While the lto.inc enables LTO across the whole image, some packages
> either manually enable LTO on their own or downstream recipe
> maintainers have explicitly set LTO in specific packages, so it is not
> sufficient to set this in lto.inc only.
> 
> [1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109805
> 
> Signed-off-by: Patrick Williams <[email protected]>
> ---

A few other mailing list threads also talk about this problem.

One alternative is to re-add it to the TARGET_LDFLAGS in bitbake.conf by
reverting 1797741aad02b8bf429fac4b81e30cdda64b5448 [1], but that seems to
have problems for cgo applications which might be resolved by another
patch[2].  Adding to lto.inc[3] isn't sufficient for the reasons I
mentioned above.

[1]: 
https://lore.kernel.org/openembedded-core/[email protected]/#t
[2]: 
https://lore.kernel.org/openembedded-core/[email protected]/
[3]: 
https://lore.kernel.org/openembedded-core/[email protected]/
-- 
Patrick Williams

Attachment: signature.asc
Description: PGP signature

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#233890): 
https://lists.openembedded.org/g/openembedded-core/message/233890
Mute This Topic: https://lists.openembedded.org/mt/118499279/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to