Displaying 1 result from an estimated 1 matches for "memcpytest".
2014 Jun 04
2
[LLVMdev] Multiple Definition error with LTO
...} person;
char myname[] = "abcd";
int main ()
{
memcpy ( person.name, myname, strlen(myname)+1 );
printf ("name :%s\n", person.name );
return 0;
}
---
During compilation with:
clang -O0 memcpy.c -o memcpy.o -c
ar cr memcpy.a memcpy.o
clang -O0 -o memcpyTest.exe -flto -static main.c memcpy.a
I get a multiple definition of memcpy error. Now building it with
-fno-builtin works fine. I'm trying to understand what is happening behind
the scenes that requires my use of -fno-builtin (or
-Wl,--allow-multiple-definitions). Did the backend put in ref...