public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "pavel51tunin at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/94156] Multiple definition of destructor and non-virtual thunk for classes that use multiple inheritance when building static library Date: Sat, 17 Oct 2020 08:52:29 +0000 [thread overview] Message-ID: <bug-94156-4-u1TDQL4SZ5@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-94156-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94156 Павел Тюнин <pavel51tunin at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pavel51tunin at gmail dot com --- Comment #2 from Павел Тюнин <pavel51tunin at gmail dot com> --- Created attachment 49391 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49391&action=edit minimal sample to reproduce the bug This sample triggers this or similar bug on both mingw 9.2.0 and mingw-w64 10.2.1. Compilation log: D:\test>g++ -O2 -flto -c test1.cpp D:\test>g++ -O2 -flto -c test2.cpp D:\test>g++ -flto -o test.exe test1.o test2.o D:/mingw-w64/mingw/bin/../lib/gcc/i686-w64-mingw32/10.2.1/../../../../i686-w64-m ingw32/bin/ld.exe: test2.o (symbol from plugin):(.gnu.linkonce.t._ZN7Derived3foo Ev[__ZThn4_N7Derived3fooEv]+0x0): multiple definition of `Derived::foo()'; test1 .o (symbol from plugin):(.gnu.linkonce.t._ZN7Derived3fooEv[__ZThn8_N7Derived3foo Ev]+0x0): first defined here D:/mingw-w64/mingw/bin/../lib/gcc/i686-w64-mingw32/10.2.1/../../../../i686-w64-m ingw32/bin/ld.exe: test2.o (symbol from plugin):(.gnu.linkonce.t._ZN7Derived3foo Ev[__ZThn4_N7Derived3fooEv]+0x0): multiple definition of `non-virtual thunk to D erived::foo()'; test1.o (symbol from plugin):(.gnu.linkonce.t._ZN7Derived3fooEv[ __ZThn8_N7Derived3fooEv]+0x0): first defined here D:/mingw-w64/mingw/bin/../lib/gcc/i686-w64-mingw32/10.2.1/../../../../i686-w64-m ingw32/bin/ld.exe: test2.o (symbol from plugin):(.gnu.linkonce.t._ZN7Derived3foo Ev[__ZThn4_N7Derived3fooEv]+0x0): multiple definition of `non-virtual thunk to D erived::foo()'; test1.o (symbol from plugin):(.gnu.linkonce.t._ZN7Derived3fooEv[ __ZThn8_N7Derived3fooEv]+0x0): first defined here collect2.exe: error: ld returned 1 exit status
next prev parent reply other threads:[~2020-10-17 8:52 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-03-12 15:05 [Bug lto/94156] New: " michal314314 at gmail dot com 2020-03-12 18:16 ` [Bug lto/94156] " michal314314 at gmail dot com 2020-10-17 8:52 ` pavel51tunin at gmail dot com [this message] 2020-10-17 15:04 ` michal314314 at gmail dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-94156-4-u1TDQL4SZ5@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).