public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/109805] New: LTO affecting -fdebug-prefix-map
@ 2023-05-11  0:48 sergiodj at sergiodj dot net
  2023-05-11  0:52 ` [Bug debug/109805] " sergiodj at sergiodj dot net
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: sergiodj at sergiodj dot net @ 2023-05-11  0:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109805

            Bug ID: 109805
           Summary: LTO affecting -fdebug-prefix-map
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sergiodj at sergiodj dot net
  Target Milestone: ---

Hi,

In Ubuntu we use -fdebug-prefix-map to remap a package's build directory (which
contains random stuff) into a predictable path under /usr/src.  This is done in
order to help debuginfod index the source code for our packages.

Things work very well, but I found a weird corner case involving LTO.  The
affected package is vim.  You can see the build logs for it here:

https://launchpadlibrarian.net/665520301/buildlog_ubuntu-mantic-amd64.vim_2%3A9.0.1378-2ubuntu1_BUILDING.txt.gz

As you can notice, we're using -fdebug-prefix-map and LTO for the build.

The problem is that the resulting debuginfo doesn't have the remaped directory.
 I can replicate the issue locally, and at first I thought this was either bug
#108464 or #87726, but after some digging I'm convinced it's something else. 
I've compiled gcc (GCC) 14.0.0 20230510 from the master branch
(608e7f3ab47fe746279c552c3574147aa3d8ee76), and I still can reproduce the
problem.

A simple reproducer for the problem follows:

$ echo 'int main(){}' > foo.c $ ~/gcc/install/bin/gcc -c foo.c -O2 -g
-flto=auto -ffat-lto-objects -fdebug-prefix-map=`pwd`=/aaaaaaa -o foo $
~/gcc/install/bin/gcc foo -flto=auto -ffat-lto-objects -o bar

A workaround for this bug is to either stop using LTO or explicitly set
-fdebug-prefix-map when linking the object.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-05-17  7:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-11  0:48 [Bug debug/109805] New: LTO affecting -fdebug-prefix-map sergiodj at sergiodj dot net
2023-05-11  0:52 ` [Bug debug/109805] " sergiodj at sergiodj dot net
2023-05-11  2:49 ` pinskia at gcc dot gnu.org
2023-05-11  2:50 ` pinskia at gcc dot gnu.org
2023-05-11  6:43 ` rguenth at gcc dot gnu.org
2023-05-11 14:36 ` sergiodj at sergiodj dot net
2023-05-11 14:38 ` sergiodj at sergiodj dot net
2023-05-12  7:25 ` rguenth at gcc dot gnu.org
2023-05-12 12:13 ` rguenth at gcc dot gnu.org
2023-05-12 12:21 ` rguenth at gcc dot gnu.org
2023-05-13 19:21 ` sergiodj at sergiodj dot net
2023-05-15  6:34 ` rguenth at gcc dot gnu.org
2023-05-15  9:20 ` rguenth at gcc dot gnu.org
2023-05-16 22:25 ` sergiodj at sergiodj dot net
2023-05-17  7:23 ` rguenther at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).