http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57267
Bug ID: 57267 Summary: [4.9 regression] -flto-partition=none : symbol is already defined Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: dimhen at gmail dot com 198366 PASS 198828 FAIL $ g++ -fpreprocessed -flto -c a.ii -o a.o $ g++ -fpreprocessed -flto -c b.ii -o b.o $ g++ -shared a.o b.o -O -flto -flto-partition=none -o x.so /tmp/ccozW37q.s: Assembler messages: /tmp/ccozW37q.s:16: Error: symbol `_ZL28__gthrw___pthread_key_createPjPFvPvE' is already defined lto-wrapper: g++ returned 1 exit status /usr/bin/ld: fatal error: lto-wrapper failed collect2: error: ld returned 1 exit status $ cat a.ii void pthread_key_create (unsigned *, void (void *)); static __typeof pthread_key_create __gthrw___pthread_key_create __attribute__ ((__weakref__ ("__pthread_key_create"))); void *a = (void *) &__gthrw___pthread_key_create; $ cat b.ii void pthread_key_create (unsigned *, void (void *)); static __typeof pthread_key_create __gthrw___pthread_key_create __attribute__ ((__weakref__ ("__pthread_key_create"))); void *__exchange_and_add_dispatch___gthread_active_ptr = (void *) &__gthrw___pthread_key_create; $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/gcc_current/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /home/dimhen/src/gcc-current/configure --prefix=/usr/local/gcc_current --with-multilib-list=m64 --enable-__cxa_atexit --enable-shared --enable-checking=yes,df,fold,rtl,tree --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,lto --enable-plugin --with-tune=native --with-march=native --enable-version-specific-runtime-libs Thread model: posix gcc version 4.9.0 20130513 (experimental) [trunk revision 198828] (GCC)