public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/95677] New: undefined reference to `(anonymous namespace)::xx'
@ 2020-06-15  8:00 sujian.liu at huawei dot com
  2020-06-15  8:12 ` [Bug c++/95677] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: sujian.liu at huawei dot com @ 2020-06-15  8:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95677
           Summary: undefined reference to `(anonymous namespace)::xx'
           Product: gcc
           Version: lto
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sujian.liu at huawei dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Created attachment 48731
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48731&action=edit
dejagnu/testsuite-7.3/g++.old-deja/g++.ns/extern1.C

When compile with lto,it will be reported the following error:

./riscv32-unknown-elf-gcc dejagnu/testsuite-7.3/g++.old-deja/g++.ns/extern1.C
-o extern1.exe -flto
                                                  
/home/lsj/gits/gcc_10_1_0/build/hcc_riscv32/riscv32_elf_build_dir/hcc_riscv32/bin/../lib/gcc/riscv32-unknown-elf/10.1.0/../../../../riscv32-unknown-elf/bin/ld:
/tmp/extern1.exe.m1gfd6.ltrans0.ltrans.o: in function `.L0 ':
<artificial>:(.text+0x6): undefined reference to `(anonymous namespace)::xx'
/home/lsj/gits/gcc_10_1_0/build/hcc_riscv32/riscv32_elf_build_dir/hcc_riscv32/bin/../lib/gcc/riscv32-unknown-elf/10.1.0/../../../../riscv32-unknown-elf/bin/ld:
<artificial>:(.text+0xa): undefined reference to `(anonymous namespace)::xx'
collect2: error: ld returned 1 exit status

It seems that lto can't deal with the extern variable in the namespace.

The testcase which is one of deja in testsuite-7.3 will be attached.

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

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

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15  8:00 [Bug lto/95677] New: undefined reference to `(anonymous namespace)::xx' sujian.liu at huawei dot com
2020-06-15  8:12 ` [Bug c++/95677] " rguenth at gcc dot gnu.org
2020-06-15  8:36 ` sujian.liu at huawei dot com
2020-06-15 12:02 ` nathan at gcc dot gnu.org
2020-06-15 12:05 ` rguenth at gcc dot gnu.org
2020-06-15 12:07 ` rguenth at gcc dot gnu.org
2020-06-15 12:28 ` nathan at gcc dot gnu.org
2020-06-18  7:34 ` sujian.liu at huawei dot com
2020-07-15  1:40 ` sujian.liu at huawei dot com
2020-09-16  8:11 ` sujian.liu at huawei dot com
2020-09-23 17:41 ` nathan at gcc dot gnu.org
2020-10-07 14:35 ` nathan 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).