public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: cygwin@cygwin.com
Subject: mingw64-* regression: LTO builds fail
Date: Fri, 08 May 2015 23:03:00 -0000	[thread overview]
Message-ID: <554D3160.1050101@t-online.de> (raw)

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

             reply	other threads:[~2015-05-08 21:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-08 23:03 Christian Franke [this message]
2015-05-09 20:41 ` JonY
2015-06-01 17:14   ` Christian Franke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=554D3160.1050101@t-online.de \
    --to=christian.franke@t-online.de \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).