From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 88F533857C4D; Sat, 17 Oct 2020 08:52:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 88F533857C4D From: "pavel51tunin at gmail dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 9.3.1 X-Bugzilla-Keywords: lto, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pavel51tunin at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 08:52:29 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94156 =D0=9F=D0=B0=D0=B2=D0=B5=D0=BB =D0=A2=D1=8E=D0=BD=D0=B8=D0=BD changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pavel51tunin at gmail dot = com --- Comment #2 from =D0=9F=D0=B0=D0=B2=D0=B5=D0=BB =D0=A2=D1=8E=D0=BD=D0=B8= =D0=BD --- Created attachment 49391 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D49391&action=3Dedit 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=