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