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
> <[email protected]> wrote:
> > Thomas Perrot via lists.openembedded.org schrieb am Di 31. Mär,
> > 10:12 (+0200):
> > > From: Thomas Perrot <[email protected]>
> > > 
> > > 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 <[email protected]>
> > > ---
> > >  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
> > > 
> > 
> > > 
> > > 
> > > 
> > 
> > 
> > 
> > 

-- 
Thomas Perrot, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

Attachment: signature.asc
Description: This is a digitally signed message part

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

Reply via email to