https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113183
Bug ID: 113183 Summary: LTO crashes with Segmentation fault Product: gcc Version: 13.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: sebunger44 at gmail dot com CC: marxin at gcc dot gnu.org Target Milestone: --- Created attachment 56968 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56968&action=edit Contains the LD and CPP files I'm in the process of creating a tool-chain and porting FreeRTOS to our Leon2 based platform and ran into this with GCC 13.2. However, after reducing it to a near trivial example, I can now also reproduce it on GCC 11.4 as shipped by Ubuntu 22.04. So it probably has nothing to do with how I compiled my GCC etc. Output: $ gcc -nostartfiles -O2 -flto -T link.ld tt.cpp -o tt ‘ Segmentation fault 0x7f23ac64251f ??? ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 0x7f23ac629d8f __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 0x7f23ac629e3f __libc_start_main_impl ../csu/libc-start.c:392 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions. lto-wrapper: fatal error: gcc returned 1 exit status compilation terminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status Note that I do not expect this example to run in any way. I have cut out all the target specific stuff so only plain old C++ remained.