https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66027
--- Comment #2 from JD <t at sharklasers dot com> --- I managed create a minimal example. bug66027 $ make -j g++ -std=c++14 -c -fPIC -march=native -O3 -flto -fuse-linker-plugin -fno-fat-lto-objects ASTContext_preproc.cpp -o ASTContext_preproc.o g++ -std=c++14 -c -fPIC -march=native -O3 -flto -fuse-linker-plugin -fno-fat-lto-objects ASTConsumer_preproc.cpp -o ASTConsumer_preproc.o ar cru libAST.a ASTContext_preproc.o ASTConsumer_preproc.o g++ -flto=4 -std=c++14 -march=native -fuse-linker-plugin -shared -o bla.so CIndex_preproc.cpp libAST.a <nullptr_type 0x7f9352ff5d20 decltype(nullptr) unsigned DI size <integer_cst 0x7f9353b9bbb8 type <integer_type 0x7f9353b9f150 bitsizetype> constant 64> unit size <integer_cst 0x7f9353b9bbd0 type <integer_type 0x7f9353b9f0a8 sizetype> constant 8> align 8 symtab 0 alias set 0 canonical type 0x7f9352ff5d20 pointer_to_this <pointer_type 0x7f9352782738> reference_to_this <reference_type 0x7f9352ff6000>> lto1: internal compiler error: in odr_types_equivalent_p, at ipa-devirt.c:1543 0x807397 odr_types_equivalent_p ../../gcc-5.1.0/gcc/ipa-devirt.c:1543 0x8076ad odr_types_equivalent_p ../../gcc-5.1.0/gcc/ipa-devirt.c:1440 0x804ca1 add_type_duplicate ../../gcc-5.1.0/gcc/ipa-devirt.c:1770 0x804ca1 get_odr_type(tree_node*, bool) ../../gcc-5.1.0/gcc/ipa-devirt.c:1959 0x80642c register_odr_type(tree_node*) ../../gcc-5.1.0/gcc/ipa-devirt.c:2034 0x63876d lto_read_decls ../../gcc-5.1.0/gcc/lto/lto.c:1952 0x6394ae lto_file_finalize ../../gcc-5.1.0/gcc/lto/lto.c:2249 0x6394ae lto_create_files_from_ids ../../gcc-5.1.0/gcc/lto/lto.c:2259 0x6394ae lto_file_read ../../gcc-5.1.0/gcc/lto/lto.c:2300 0x6394ae read_cgraph_and_symbols ../../gcc-5.1.0/gcc/lto/lto.c:3005 0x6394ae lto_main() ../../gcc-5.1.0/gcc/lto/lto.c:3475 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. lto-wrapper: fatal error: g++ returned 1 exit status compilation terminated. /usr/bin/ld: lto-wrapper failed collect2: error: ld returned 1 exit status Makefile:7: recipe for target 'all' failed make: *** [all] Error 1 ld -v GNU ld (GNU Binutils; openSUSE 13.2) 2.24.0.20140403-6.1 gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/home/german/local/gcc5.1/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-5.1.0/configure --prefix=/home/german/local/gcc5.1 --enable-languages=c,c++ --enable-gold=yes --enable-ld=yes --enable-lto --enable-bootstrap --disable-multilib Thread model: posix gcc version 5.1.0 (GCC) ar --version GNU ar (GNU Binutils; openSUSE 13.2) 2.24.0.20140403-6.1