From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17391 invoked by alias); 2 Aug 2013 14:52:13 -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 17326 invoked by uid 48); 2 Aug 2013 14:52:10 -0000 From: "mib.bugzilla at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58060] New: separate compilation of gnu multiversioning gives undefined/multiple defined symbols at link time Date: Fri, 02 Aug 2013 14:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mib.bugzilla at gmail dot com 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: 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: 2013-08/txt/msg00130.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58060 Bug ID: 58060 Summary: separate compilation of gnu multiversioning gives undefined/multiple defined symbols at link time Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mib.bugzilla at gmail dot com Created attachment 30592 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30592&action=edit test case part 1 I tried gnu multiversioning with separate compilation but I get both these messages at link time: multiple defined symbols and undefined symbol. g++ -o foo.exe mv6c-1.o mv6c.o mv6c.o: In function `foo()': mv6c.C:(.text+0x0): multiple definition of `foo()' mv6c-1.o:mv6c-1.C:(.text+0x0): first defined here mv6c-1.o: In function `_Z3foov.resolver': mv6c-1.C:(.text._Z3foov.resolver[_Z3foov.resolver]+0x1b): undefined reference to `_Z3foov.arch_corei7' collect2: error: ld returned 1 exit status -bash-4.1$ cp mv6c*C ~/my_home -bash-4.1$ cat mv6c.C /* corei7 version of foo. */ __attribute__ ((target("arch=corei7"))) int foo () { return 7; } // I thought this compilation unit would create a function with the name arch_corei7, but it just creates a foo without target decoration