This is the mail archive of the
cygwin
mailing list for the Cygwin project.
ld segfaults with -flto after upgrading to gcc 4.8.3-3 (64-bit)
- From: "Christoph H. Hochstaetter" <christoph at hochstaetter dot de>
- To: cygwin at cygwin dot com
- Date: Fri, 22 Aug 2014 02:20:29 +0200
- Subject: ld segfaults with -flto after upgrading to gcc 4.8.3-3 (64-bit)
- Authentication-results: sourceware.org; auth=none
Hi,
I just upgraded gcc from 4.8.3-2 to 4.8.3-3. ld segfaults if gcc (and thus
ld) is used with link time optimization (-flto).
[ch@laptop2 ~] $ gcc -o hello.exe hello.c
[ch@laptop2 ~] $ ./hello.exe
Hello world!
[ch@laptop2 ~] $ rm -f hello.exe
[ch@laptop2 ~] $ gcc -o hello.exe hello.c -flto
collect2: error: ld terminated with signal 11 [Segmentation fault]
[ch@laptop2 ~] $ ./hello.exe
Hello world!
[ch@laptop2 ~] $
Besides from segfaulting ld creates a working hello.exe. I've also
compiled some more complex projects with several *.o files. EXEs all work
great. Tested on two different machines (both Windows 8.1 Update 1
64-bit). Binutils is 2.24.51-5 [GNU ld (GNU Binutils) 2.24.51.20140703]
before and after gcc upgrade. Reverting to gcc 4.8.3-2 solves the problem.
Same behavior if g++ is used to compile (works with 4.8.3-2, ld segfaults
with 4.8.3-3)
To be complete, here is my hello.c (segfault occurs with any file you
compile and link with -flto):
#include <stdio.h>
int main(int argc, char** argv)
{
printf("Hello world!\n");
return 0;
}
Regards
-Christoph
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple