[Bug lto/64860] New: multiple definition of typeinfo in 5.0 (4.9.2 works)

sirl at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jan 29 15:09:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64860

            Bug ID: 64860
           Summary: multiple definition of typeinfo in 5.0 (4.9.2 works)
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sirl at gcc dot gnu.org

Created attachment 34617
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34617&action=edit
Simple testcase. Use "make" to reproduce.

While trying to construct a testcase for a 4.8 to 4.9 change of LTO linking
behaviour, I stumbled over this (just re-tested with r220248):

g++-5 -flto -fuse-linker-plugin -O2 -Wall -Wextra -c file1.cpp
g++-5 -flto -fuse-linker-plugin -O2 -Wall -Wextra -c file2.cpp
gcc-5  -flto -fuse-linker-plugin -Wl,-r -nostdlib -o lib1.lib file1.o
gcc-5  -flto -fuse-linker-plugin -Wl,-r -nostdlib -o lib2.lib file2.o
g++-5 -flto -fuse-linker-plugin -O2 -o testexe lib1.lib lib2.lib
lib2.lib:(.rodata+0x0): multiple definition of `typeinfo name for CDialogBase'
lib1.lib:(.rodata+0x0): first defined here
collect2: error: ld returned 1 exit status

# g++-5 -v
Using built-in specs.
COLLECT_GCC=g++-5
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/5/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,fortran --with-gxx-include-dir=/usr/include/c++/5
--enable-ssp --disable-libssp --disable-libvtv --disable-plugin
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--with-default-libstdcxx-abi=c++98 --enable-version-specific-runtime-libs
--enable-linker-build-id --enable-linux-futex --program-suffix=-5
--without-system-libunwind --enable-multilib --with-arch-32=i586
--with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux
Thread model: posix
gcc version 5.0.0 20150129 (experimental) (SUSE Linux)

gcc-4.8.3 and 4.9.2 compile and link the same code just fine.



More information about the Gcc-bugs mailing list