From: Patrick Williams <patrick@stwcx.xyz>
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] gcc: fix buildpaths QA with LTO
Date: Wed, 25 Mar 2026 07:46:27 -0400 [thread overview]
Message-ID: <acPLE7KjSfvxXthX@heinlein> (raw)
In-Reply-To: <20260325113951.1278864-1-patrick@stwcx.xyz>
[-- Attachment #1: Type: text/plain, Size: 1585 bytes --]
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 <patrick@stwcx.xyz>
> ---
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/20260122194959.13457-2-rs@ti.com/#t
[2]: https://lore.kernel.org/openembedded-core/20260127170344.2960247-2-rs@ti.com/
[3]: https://lore.kernel.org/openembedded-core/20260204052638.284617-1-changqing.li@windriver.com/
--
Patrick Williams
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 870 bytes --]
next prev parent reply other threads:[~2026-03-25 11:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-25 11:39 [PATCH] gcc: fix buildpaths QA with LTO Patrick Williams
2026-03-25 11:46 ` Patrick Williams [this message]
2026-03-25 12:34 ` [OE-core] " Richard Purdie
2026-03-25 12:44 ` Patrick Williams
2026-03-25 12:53 ` Richard Purdie
2026-03-25 13:09 ` Patrick Williams
2026-03-25 14:25 ` Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=acPLE7KjSfvxXthX@heinlein \
--to=patrick@stwcx.xyz \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.