public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/109263] New: '-g0 -ggdb -flto' gives linker error
@ 2023-03-23 15:10 lukeocamden at gmail dot com
  2023-03-23 15:14 ` [Bug lto/109263] " marxin at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: lukeocamden at gmail dot com @ 2023-03-23 15:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109263
           Summary: '-g0 -ggdb -flto' gives linker error
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lukeocamden at gmail dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Hello,

I have not seen this before!

$ echo 'int main() { }' | g++ -g0 -ggdb -flto -xc++ -
/usr/bin/ld: /tmp/ccgMzjuI.ltrans0.ltrans.o:(.debug_info+0x2f): undefined
reference to `g_stdin_.7138a6a3'
collect2: error: ld returned 1 exit status

$ g++ --version
g++ (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Unfortunately my build too insists on -g0 so I am using this as a workaround:

$ echo 'int main() { }' | g++ -g0 -g -ggdb -flto -xc++ -

Thanks!

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

* [Bug lto/109263] '-g0 -ggdb -flto' gives linker error
  2023-03-23 15:10 [Bug lto/109263] New: '-g0 -ggdb -flto' gives linker error lukeocamden at gmail dot com
@ 2023-03-23 15:14 ` marxin at gcc dot gnu.org
  2023-03-23 15:58 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-03-23 15:14 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-03-23
                 CC|                            |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Btw. started with r10-3107-g5a307ee54bca6386.

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

* [Bug lto/109263] '-g0 -ggdb -flto' gives linker error
  2023-03-23 15:10 [Bug lto/109263] New: '-g0 -ggdb -flto' gives linker error lukeocamden at gmail dot com
  2023-03-23 15:14 ` [Bug lto/109263] " marxin at gcc dot gnu.org
@ 2023-03-23 15:58 ` rguenth at gcc dot gnu.org
  2023-03-23 18:24 ` [Bug lto/109263] [10/11/12/13 Regression] " pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-03-23 15:58 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
So we stream -g in .lto_options and we do have early LTO debug.  But then
nothing combines -g0 -ggdb in the driver so lto-wrapper also sees -g0
and thinks that will prevail, setting skip_debug to true.

Unfortunately -ggdb isn't just -g with "gdb" as arg but an entirely separate
option.

Interestingly -gno-dwarf enables debug info as well.

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

* [Bug lto/109263] [10/11/12/13 Regression] '-g0 -ggdb -flto' gives linker error
  2023-03-23 15:10 [Bug lto/109263] New: '-g0 -ggdb -flto' gives linker error lukeocamden at gmail dot com
  2023-03-23 15:14 ` [Bug lto/109263] " marxin at gcc dot gnu.org
  2023-03-23 15:58 ` rguenth at gcc dot gnu.org
@ 2023-03-23 18:24 ` pinskia at gcc dot gnu.org
  2023-03-27  6:45 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-23 18:24 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|'-g0 -ggdb -flto' gives     |[10/11/12/13 Regression]
                   |linker error                |'-g0 -ggdb -flto' gives
                   |                            |linker error
   Target Milestone|---                         |10.5
           Keywords|                            |link-failure

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

* [Bug lto/109263] [10/11/12/13 Regression] '-g0 -ggdb -flto' gives linker error
  2023-03-23 15:10 [Bug lto/109263] New: '-g0 -ggdb -flto' gives linker error lukeocamden at gmail dot com
                   ` (2 preceding siblings ...)
  2023-03-23 18:24 ` [Bug lto/109263] [10/11/12/13 Regression] " pinskia at gcc dot gnu.org
@ 2023-03-27  6:45 ` cvs-commit at gcc dot gnu.org
  2023-03-27  6:46 ` [Bug lto/109263] [10/11/12 " rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-27  6:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:4cbd5ef0350d8ab04993eb4c48ab80999fb4f358

commit r13-6872-g4cbd5ef0350d8ab04993eb4c48ab80999fb4f358
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Mar 23 16:56:53 2023 +0100

    lto/109263 - lto-wrapper and -g0 -ggdb

    The following makes lto-wrapper deal with non-combined debug
    disabling / enabling option combinations properly.  Interestingly
    -gno-dwarf also enables debug.

            PR lto/109263
            * lto-wrapper.cc (run_gcc): Parse alternate debug options
            as well, they always enable debug.

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

* [Bug lto/109263] [10/11/12 Regression] '-g0 -ggdb -flto' gives linker error
  2023-03-23 15:10 [Bug lto/109263] New: '-g0 -ggdb -flto' gives linker error lukeocamden at gmail dot com
                   ` (3 preceding siblings ...)
  2023-03-27  6:45 ` cvs-commit at gcc dot gnu.org
@ 2023-03-27  6:46 ` rguenth at gcc dot gnu.org
  2023-04-17  9:14 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-03-27  6:46 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |13.0
            Summary|[10/11/12/13 Regression]    |[10/11/12 Regression] '-g0
                   |'-g0 -ggdb -flto' gives     |-ggdb -flto' gives linker
                   |linker error                |error
      Known to fail|                            |12.2.0

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk sofar.

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

* [Bug lto/109263] [10/11/12 Regression] '-g0 -ggdb -flto' gives linker error
  2023-03-23 15:10 [Bug lto/109263] New: '-g0 -ggdb -flto' gives linker error lukeocamden at gmail dot com
                   ` (4 preceding siblings ...)
  2023-03-27  6:46 ` [Bug lto/109263] [10/11/12 " rguenth at gcc dot gnu.org
@ 2023-04-17  9:14 ` cvs-commit at gcc dot gnu.org
  2023-05-02 12:45 ` [Bug lto/109263] [10/11 " cvs-commit at gcc dot gnu.org
  2023-07-07 10:07 ` [Bug lto/109263] [10 " rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-17  9:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:42b3d387f7335a4bc8846e3b7a2a78fb47be68b2

commit r12-9410-g42b3d387f7335a4bc8846e3b7a2a78fb47be68b2
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Mar 23 16:56:53 2023 +0100

    lto/109263 - lto-wrapper and -g0 -ggdb

    The following makes lto-wrapper deal with non-combined debug
    disabling / enabling option combinations properly.  Interestingly
    -gno-dwarf also enables debug.

            PR lto/109263
            * lto-wrapper.cc (run_gcc): Parse alternate debug options
            as well, they always enable debug.

    (cherry picked from commit 4cbd5ef0350d8ab04993eb4c48ab80999fb4f358)

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

* [Bug lto/109263] [10/11 Regression] '-g0 -ggdb -flto' gives linker error
  2023-03-23 15:10 [Bug lto/109263] New: '-g0 -ggdb -flto' gives linker error lukeocamden at gmail dot com
                   ` (5 preceding siblings ...)
  2023-04-17  9:14 ` cvs-commit at gcc dot gnu.org
@ 2023-05-02 12:45 ` cvs-commit at gcc dot gnu.org
  2023-07-07 10:07 ` [Bug lto/109263] [10 " rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-02 12:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:d4baf9f030f3b61499f3e83a3f5fc39bc8427cb5

commit r11-10680-gd4baf9f030f3b61499f3e83a3f5fc39bc8427cb5
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Mar 23 16:56:53 2023 +0100

    lto/109263 - lto-wrapper and -g0 -ggdb

    The following makes lto-wrapper deal with non-combined debug
    disabling / enabling option combinations properly.  Interestingly
    -gno-dwarf also enables debug.

            PR lto/109263
            * lto-wrapper.c (run_gcc): Parse alternate debug options
            as well, they always enable debug.

    (cherry picked from commit 4cbd5ef0350d8ab04993eb4c48ab80999fb4f358)

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

* [Bug lto/109263] [10 Regression] '-g0 -ggdb -flto' gives linker error
  2023-03-23 15:10 [Bug lto/109263] New: '-g0 -ggdb -flto' gives linker error lukeocamden at gmail dot com
                   ` (6 preceding siblings ...)
  2023-05-02 12:45 ` [Bug lto/109263] [10/11 " cvs-commit at gcc dot gnu.org
@ 2023-07-07 10:07 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:07 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.4
             Status|ASSIGNED                    |RESOLVED
      Known to fail|                            |10.5.0
         Resolution|---                         |FIXED

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed in GCC 11.4

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

end of thread, other threads:[~2023-07-07 10:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-23 15:10 [Bug lto/109263] New: '-g0 -ggdb -flto' gives linker error lukeocamden at gmail dot com
2023-03-23 15:14 ` [Bug lto/109263] " marxin at gcc dot gnu.org
2023-03-23 15:58 ` rguenth at gcc dot gnu.org
2023-03-23 18:24 ` [Bug lto/109263] [10/11/12/13 Regression] " pinskia at gcc dot gnu.org
2023-03-27  6:45 ` cvs-commit at gcc dot gnu.org
2023-03-27  6:46 ` [Bug lto/109263] [10/11/12 " rguenth at gcc dot gnu.org
2023-04-17  9:14 ` cvs-commit at gcc dot gnu.org
2023-05-02 12:45 ` [Bug lto/109263] [10/11 " cvs-commit at gcc dot gnu.org
2023-07-07 10:07 ` [Bug lto/109263] [10 " rguenth at gcc dot gnu.org

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).