This is the mail archive of the
cygwin
mailing list for the Cygwin project.
mingw64-* regression: LTO builds fail
- From: Christian Franke <Christian dot Franke at t-online dot de>
- To: cygwin at cygwin dot com
- Date: Fri, 08 May 2015 23:57:52 +0200
- Subject: mingw64-* regression: LTO builds fail
- Authentication-results: sourceware.org; auth=none
After upgrading to recent mingw64 toolchain, builds with link time
optimizer fail during linking.
Testcase:
$ cat true.c
int main() { return 0; }
$ cygcheck -f /usr/bin/i686-w64-mingw32-gcc
mingw64-i686-gcc-core-4.9.2-1
$ cygcheck -f /usr/bin/i686-w64-mingw32-ld
mingw64-i686-binutils-2.25.0.1.23f238d-1
$ i686-w64-mingw32-gcc -flto true.c
/tmp/ccukCXyi.ltrans0.ltrans.o:ccukCXyi.ltrans0.o:(.text+0x0): multiple
definition of `main'
/usr/i686-w64-mingw32/sys-root/mingw/lib/../lib/libmingw32.a(lib32_libmingw32_a-crt0_c.o):/usr/src/debug/mingw64-i686-runtime-4.0.2-1/crt/crt0_c.c:17:
first defined here
/usr/i686-w64-mingw32/sys-root/mingw/lib/../lib/libmingw32.a(lib32_libmingw32_a-crt0_c.o):
In function `main':
/usr/src/debug/mingw64-i686-runtime-4.0.2-1/crt/crt0_c.c:18: undefined
reference to `WinMain@16'
collect2: error: ld returned 1 exit status
Same with x86_64 mingw.
Downgrading the mingw64 binutils package helps:
$ cygcheck -f /usr/bin/i686-w64-mingw32-gcc
mingw64-i686-gcc-core-4.9.2-1
$ cygcheck -f /usr/bin/i686-w64-mingw32-ld
mingw64-i686-binutils-2.24.0.3.85cf705-1
$ i686-w64-mingw32-gcc -flto true.c
May or may not be an upstream issue. The current mingw64 toolchain on
Debian jessie (gcc 4.9.1-19+14.3, binutils 2.25-5+5.2) works as expected.
Christian
--
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