http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61012
Bug ID: 61012 Summary: lto1: errors during merging of translation units (error: variable ‘link’ redeclared as function) Product: gcc Version: 4.10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mliska at suse dot cz $ cat a.c struct s { int a; int b; }; static struct s link = { 1, 2 }; int foo() { return link.a; } $ cat b.c #include <unistd.h> int main() { int r = link("aaa", "bbb"); return foo(); } $ gcc a.c b.c -flto -O2 /usr/include/unistd.h:812:12: error: variable ‘link’ redeclared as function extern int link (const char *__from, const char *__to) ^ a.c:7:17: note: previously declared here static struct s link = { 1, 2 }; ^ lto1: fatal error: errors during merging of translation units compilation terminated. lto-wrapper: gcc returned 1 exit status /home/marxin/Programming/bin/gcc2/lib64/gcc/x86_64-unknown-linux-gnu/4.10.0/../../../../x86_64-unknown-linux-gnu/bin/ld: fatal error: lto-wrapper failed collect2: error: ld returned 1 exit status