https://sourceware.org/bugzilla/show_bug.cgi?id=26103
Bug ID: 26103 Summary: Assertion failure at ldlang.c:7269 when compiling with LTO on MinGW Product: binutils Version: 2.35 (HEAD) Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: markus.boeck02 at gmail dot com Target Milestone: --- Since a patch that has been included in GCC 9 using LTO with target x86_64-mingw32 has been causing an assertion in ld when using a static build of libstdc++. I have looked around and found a similar issue here: https://sourceware.org/bugzilla/show_bug.cgi?id=24567 and applied the same logging which yields following result: A:c:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10/crtend.o B:c:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10/crtend.o A:C:\Users\Markus\AppData\Local\Temp\ccnx0ebg.ltrans0.ltrans.o B:C:\Users\Markus\AppData\Local\Temp\ccnx0ebg.ltrans0.ltrans.o A:(c:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10\libstdc++.a)ios.o B:c:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10\libstdc++.a(ios.o) C:c:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10\libstdc++.a(iostream-inst.o) c:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10/../../../../x86_64-w64-mingw32/bin/ld.exe: internal error ../../ld/ldlang.c 7274 collect2.exe: error: ld returned 1 exit status A simple reproduction is a cpp file with the content: #include <sstream> int main() { std::stringstream ss; } which must then be compiled using the command g++-10 -static-libstdc++ -flto -fno-fat-lto-objects test.cpp Tested specifically with ld from current master (cebd6b8ac1c5a2a847a50e3efe932ff2d0867b3e) and current HEAD of GCC 8 (33ebf40daa79a73e66c379728b4c0ef7297297fe), GCC 9 (6dee1cefd81bd7e5fb1fbee727794e073f5e34a6) and GCC 10 (7783ab7bceb912373d9513af658aba40ede87b1b) on both windows and linux as host operating system -- You are receiving this mail because: You are on the CC list for the bug.