autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

autoconf tests and stdcall name mangling


From: Dimitrios Apostolou
Subject: autoconf tests and stdcall name mangling
Date: Wed, 22 May 2013 20:22:32 +0200 (CEST)
User-agent: Alpine 2.02 (DEB 1266 2009-07-14)

(Not sure which list is relevant, so I'm cross-posting to both mingw-users and autoconf lists)

Hello lists,

when I'm cross compiling from linux x86_64 to 32-bit MinGW autoconf refuses to detect getaddrinfo and define HAVE_GETADDRINFO. I've limited the case to the following behaviour:

The "getaddrinfo-link.c" attached file is a simplification of what AC_REPLACE_FUNCS(getaddrinfo) tries to compile and link. It fails to find the symbol because gcc most probably doesn't use proper calling conventions (stdcall). This is demonstrated by the build success of the second attached program. So:

$ i686-w64-mingw32-gcc     -o getaddrinfo-link getaddrinfo-link.c    -lws2_32
/tmp/cctQtw3q.o:getaddrinfo-link.c:(.text+0xc): undefined reference to 
`_getaddrinfo'
collect2: ld returned 1 exit status
$ i686-w64-mingw32-gcc     -o getaddrinfo-link getaddrinfo-link-2.c    -lws2_32
$

In the second case ("getaddrinfo-link-2.c") compilation is successful because the symbol linked is "address@hidden" which actually exists in ws2_32 (verified it with nm). Here is the version of my toolchain:

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

Any idea what's the proper way to use AC_REPLACE_FUNCS in this case?


Thanks in advance,
Dimitris

Attachment: getaddrinfo-link-2.c
Description: Text Data

Attachment: getaddrinfo-link.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]