https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94776
Bug ID: 94776
Summary: lto1: internal compiler error: in
add_symbol_to_partition_1, at lto/lto-partition.c:153
Product: gcc
Version: lto
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: lto
Assignee: unassigned at gcc dot gnu.org
Reporter: michal314314 at gmail dot com
CC: marxin at gcc dot gnu.org
Target Milestone: ---
The setup and projects being compiled are the same as in bug 94156 (just newer
commits), however this time instead of getting linker symbol-related errors the
linker crashes.
link command:
C:\mingw64\mingw64\bin\gcc-ar.exe cr CMakeFiles\filter_spirit_gui.dir/objects.a
CMakeFiles/filter_spirit_gui.dir/main.cpp.obj
C:\mingw64\mingw64\bin\g++.exe -O3 -DNDEBUG -flto -fno-fat-lto-objects
-Wl,--whole-archive CMakeFiles\filter_spirit_gui.dir/objects.a
-Wl,--no-whole-archive -o ..\..\bin\filter_spirit_gui.exe
-Wl,--out-implib,..\..\bin\libfilter_spirit_gui.dll.a
-Wl,--major-image-version,0,--minor-image-version,0 -LC:/usr/include/../bin
../../bin/libfilter_spirit.dll.a ../../bin/libelements.a
C:/mingw64/mingw64/lib/libssl.dll.a
C:/mingw64/mingw64/lib/libboost_filesystem-mt.dll.a -lcurl -latomic
C:/usr/lib/libcairo.dll.a C:/usr/lib/libfontconfig.dll.a
C:/usr/lib/libfreetype.dll.a C:/usr/lib/libpng16.dll.a
C:/mingw64/mingw64/lib/libz.dll.a C:/mingw64/mingw64/lib/libbz2.dll.a -lpthread
-lws2_32 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32
-luuid -lcomdlg32 -ladvapi32
Full output:
lto1.exe: internal compiler error: in add_symbol_to_partition_1, at
lto/lto-partition.c:153
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc-mcf.lhmouse.com/> for instructions.
My toolchain:
$ g++ -v
Using built-in specs.
COLLECT_GCC=C:\mingw64\mingw64\bin\g++.exe
COLLECT_LTO_WRAPPER=C:/mingw64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.1/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-git/configure --prefix=/mingw64
--with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
--with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include
--libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64
--with-tune=nocona --enable-languages=c,lto,c++ --enable-shared --enable-static
--enable-threads=mcf --enable-graphite --enable-fully-dynamic-string
--enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug
--enable-libstdcxx-filesystem-ts=yes --disable-isl-version-check --enable-lto
--enable-libgomp --disable-multilib --enable-checking=release --disable-rpath
--disable-win32-registry --enable-nls --disable-werror --disable-symvers
--with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64
--with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='GCC with MCF thread
model, built by LH_Mouse.' --with-bugurl=https://gcc-mcf.lhmouse.com/
--with-gnu-as --with-gnu-ld --disable-tls --enable-plugin
Thread model: mcf
gcc version 9.2.1 20200225 (GCC with MCF thread model, built by LH_Mouse.)
$ ld --version
GNU ld (GNU Binutils) 2.33.1
$ cmake --version
cmake version 3.16.4
I have successfuly used -save-temps option but unfortunately both created
temporary files are huge (main.s is 1.5MB, main.ii is 7.2MB) which is beyond
allowed attachment size.
This issue is hard to reproduce on different commits (probably due to all
optimizations taking place) and only appears when link time optimization is
used. Please guide me if I can help in any way with reproducing this problem.
Right now it happens on a small hello world main.cpp that uses 2 libraries, but
unfortunately both use a ton of boost which significantly increases the amount
of actual code in the compiled translation unit.