From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24772 invoked by alias); 30 Jan 2015 11:24:06 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 24558 invoked by uid 48); 30 Jan 2015 11:23:53 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/64275] Warnings when linking GCC go1: "(virtual table of) type 'struct X' violates one definition rule" Date: Fri, 30 Jan 2015 11:24:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: lto X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg03504.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64275 --- Comment #2 from Jonathan Wakely --- The simplest way to solve this might be to replace the extern declarations in ios_init.cc such as: extern stdio_sync_filebuf buf_cout_sync; with a pointer: extern stdio_sync_filebuf* buf_cout_sync_p; then in globals_io.cc do: stdio_sync_filebuf* buf_cout_sync_p = reintepret_cast*>(buf_cout_sync); That way we have an explicit cast rather than just relying on the linker finding the symbol.