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!

Reply via email to