linker error with gcc flag -mfunction-return=thunk

Corinna Vinschen
Mon Jun 25 14:08:00 GMT 2018

On Jun 25 14:08, Michael Haubenwallner wrote:
> Hi,
> I'm encountering a package's configure script (openssh-7.7p1) that
> successfully tests for the compiler flag "-mfunction-return=thunk",
> which causes subsequent linker errors (and fails to identify zlib):
>  relocation truncated to fit: R_X86_64_32S against `.text'
> The compiler used is gcc-7.3.0 with binutils- (current),
> and the easiest test case here is:
> $ echo 'int main() { return 0; }' > conftest.c
> $ gcc -mfunction-return=thunk conftest.c
> /tmp/ccv1Ird0.o:conftest.c:(.text+0x1a): relocation truncated to fit: R_X86_64_32S against `.text'
> collect2: error: ld returned 1 exit status
> Not sure though where to finally report this problem:
> * openssh, as they should do a link-test rather than compile-test
> * gcc, as their generated code is wrong for cygwin
> * binutils, as their ld is unable to link that code
> * cygwin, as the maintainers of cygwin support in binutils+gcc
> After all, openssh-7.7p1-1.src cygwin package currently fails to compile.

configure with --without-hardening for the time being.


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: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <>

More information about the Cygwin mailing list