From: Thomas Perrot <thomas.perrot@bootlin.com>
To: raj.khem@gmail.com, joerg.sommer@navimatix.de
Cc: thomas.perrot@bootlin.com,
openembedded-core@lists.openembedded.org,
thomas.petazzoni@bootlin.com
Subject: Re: [OE-core][PATCH] lto: disable for expect and add DEBUG_PREFIX_MAP to ldflags
Date: Tue, 31 Mar 2026 22:27:08 +0200 [thread overview]
Message-ID: <9ea28268b4644e2c2db54a551c364298700ba619.camel@bootlin.com> (raw)
In-Reply-To: <CAMKF1so2416tJiJrPw8KQeJCXY-S=SQsGiJMjGE2d6T86NJznQ@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 4516 bytes --]
Hello,
On Tue, 2026-03-31 at 12:45 -0700, Khem Raj via lists.openembedded.org
wrote:
>
>
> On Tue, Mar 31, 2026 at 8:40 AM Jörg Sommer via
> lists.openembedded.org
> <joerg.sommer=navimatix.de@lists.openembedded.org> wrote:
> > Thomas Perrot via lists.openembedded.org schrieb am Di 31. Mär,
> > 10:12 (+0200):
> > > From: Thomas Perrot <thomas.perrot@bootlin.com>
> > >
> > > Disable LTO for the expect package and append DEBUG_PREFIX_MAP to
> > > TARGET_LDFLAGS when LTO is enabled, ensuring debug info remapping
> > > is applied consistently alongside LTO flags.
> > >
> > > Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
> > > ---
> > > meta/conf/distro/include/lto.inc | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > diff --git a/meta/conf/distro/include/lto.inc
> > b/meta/conf/distro/include/lto.inc
> > > index 8752249685a4..c66dfc5a8074 100644
> > > --- a/meta/conf/distro/include/lto.inc
> > > +++ b/meta/conf/distro/include/lto.inc
> > > @@ -4,6 +4,7 @@
> > > #
> > >
> > > # Disable LTO for following packages
> > > +LTO:pn-expect = ""
> >
> > I suspect this is due to the gcc bug not because LTO is unsuitable
> > for
> > expect. Might it be a good idea to move all excludes due to the gcc
> > bug in
> > its own block? This would make it easier to revert them when the
> > bug gets
> > resolved.
> >
> >
>
>
> I also wonder if the issue is gcc specific and works with TOOLCHAIN =
> "clang"
I investigated further and can confirm your suspicion, this is indeed a
GCC bug,
not an incompatibility between LTO and expect.
With -v added to LDFLAGS, I verified that -ffile-prefix-map flags
are correctly passed to lto1. However, the raw TMPDIR path does not
come from expect's own compilation, it leaks from tcl8 via the
.debug_line_str section:
$ readelf --debug-dump=line libexpect5.45.4.so | grep '/src/build'
0 (indirect line string, offset: 0x7de):
/src/build/tmp/work/.../tcl8/8.6.17/build
During LTO, when GCC incorporates debug info from a linked dependency
(tcl8 here), the directory entries in .debug_line_str are not subject
to prefix remapping. DW_AT_comp_dir is correctly remapped, but
.debug_line_str is not.
This is not expect-specific, any package linking against tcl8 with LTO
could be affected.
Your suggestion to group packages disabled due to this GCC bug
in a separate block, I think it's a good idea.
Kind regards,
Thomas
>
> > > LTO:pn-glibc = ""
> > > LTO:pn-gcc-runtime = ""
> > > LTO:pn-libgcc-initial = ""
> > > --
> > > 2.53.0
> > >
> >
> > >
> > >
> > >
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#234313):
> > https://lists.openembedded.org/g/openembedded-core/message/234313
> > Mute This Topic:
> > https://lists.openembedded.org/mt/118593189/5443093
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe:
> > https://lists.openembedded.org/g/openembedded-core/unsub [
> > thomas.perrot@bootlin.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
--
Thomas Perrot, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
[-- Attachment #1.2: Type: text/html, Size: 9104 bytes --]
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
prev parent reply other threads:[~2026-03-31 20:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 8:12 [OE-core][PATCH] lto: disable for expect and add DEBUG_PREFIX_MAP to ldflags thomas.perrot
2026-03-31 14:12 ` Richard Purdie
2026-03-31 14:17 ` Thomas Perrot
2026-03-31 15:40 ` Jörg Sommer
2026-03-31 19:45 ` Khem Raj
2026-03-31 20:27 ` Thomas Perrot [this message]
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=9ea28268b4644e2c2db54a551c364298700ba619.camel@bootlin.com \
--to=thomas.perrot@bootlin.com \
--cc=joerg.sommer@navimatix.de \
--cc=openembedded-core@lists.openembedded.org \
--cc=raj.khem@gmail.com \
--cc=thomas.petazzoni@bootlin.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox