This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: GNU ld -O option breaks compilation
- From: VÃclav Zeman <vhaisman at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Fri, 16 Aug 2013 14:29:53 +0200
- Subject: Re: GNU ld -O option breaks compilation
- References: <CAKw7uVjHcZbuxhAYjtBeZ=kiNF2hhuWUNLRuo+y8t5tZsj7f6Q at mail dot gmail dot com> <20130816104848 dot GG2562 at calimero dot vinschen dot de>
On 16 August 2013 12:48, Corinna Vinschen wrote:
> 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.
Ok. I have expected it to do nothing (no optimization) on non-ELF targets.
--
VZ
--
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