public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* mingw64-* regression: LTO builds fail
@ 2015-05-08 23:03 Christian Franke
  2015-05-09 20:41 ` JonY
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Franke @ 2015-05-08 23:03 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mingw64-* regression: LTO builds fail
  2015-05-08 23:03 mingw64-* regression: LTO builds fail Christian Franke
@ 2015-05-09 20:41 ` JonY
  2015-06-01 17:14   ` Christian Franke
  0 siblings, 1 reply; 3+ messages in thread
From: JonY @ 2015-05-09 20:41 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 252 bytes --]

On 5/9/2015 05:57, Christian Franke wrote:
> After upgrading to recent mingw64 toolchain, builds with link time
> optimizer fail during linking.
> 

Can you try with the upstream binutils git version? It is most likely a
new regression.





[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mingw64-* regression: LTO builds fail
  2015-05-09 20:41 ` JonY
@ 2015-06-01 17:14   ` Christian Franke
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Franke @ 2015-06-01 17:14 UTC (permalink / raw)
  To: cygwin

JonY wrote:
> On 5/9/2015 05:57, Christian Franke wrote:
>> After upgrading to recent mingw64 toolchain, builds with link time
>> optimizer fail during linking.
>>
> Can you try with the upstream binutils git version? It is most likely a
> new regression.

Sorry for the delay.

Same result with a build from upstream binutils git version bd16da5:

$ i686-w64-mingw32-ld --version
GNU ld (GNU Binutils) 2.25.51.20150601

$ i686-w64-mingw32-gcc --version
i686-w64-mingw32-gcc (GCC) 4.9.2

$ i686-w64-mingw32-gcc -flto true.c
/tmp/ccA4vxFb.ltrans0.ltrans.o:ccA4vxFb.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


Downgrading to "prev" package fixes this.

$ i686-w64-mingw32-ld --version
GNU ld (GNU Binutils) 2.24.51.20140411


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-01 17:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-08 23:03 mingw64-* regression: LTO builds fail Christian Franke
2015-05-09 20:41 ` JonY
2015-06-01 17:14   ` Christian Franke

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).