GNU ld -O option breaks compilation

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Aug 16 10:48:00 GMT 2013


On Aug 16 10:50, Václav Zeman wrote:
> I am getting compilation error when I try to use the GNU ld's -O option:
> 
> `--> cat test.c
> int
> main ()
> {
>     return 0;
> }
> 
> `--> gcc -Wl,-O -o test test.c
> /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/../../../../lib/libcygwin.a(libcmain.o):
> In function `main':
> /usr/src/debug/cygwin-1.7.24-1/winsup/cygwin/lib/libcmain.c:39:
> undefined reference to `WinMain'
> /usr/src/debug/cygwin-1.7.24-1/winsup/cygwin/lib/libcmain.c:39:(.text.startup+0x7e):
> relocation truncated to fit: R_X86_64_PC32 against undefined symbol
> `WinMain'
> collect2: error: ld returned 1 exit status

Per the ld info pages, the -O option is only designed to work for
ELF shared libraries so far.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20130816/f1c8c74e/attachment.sig>


More information about the Cygwin mailing list