cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Name lookup/DNS resolution mechanism of libcurl

From: Michael-O <1983-01-06_at_gmx.net>
Date: Mon, 01 Apr 2013 23:24:20 +0200

Am 2013-04-01 22:52, schrieb Guenter:
> Hi Michael,
> On 01.04.2013 22:36, Michael-O wrote:
>> I have created an issue for this: https://www.virtualbox.org/ticket/11663
>>
>> Daniel, you may want to add this as a known issue.
> 1st we need to know if this is also an issue with the default windows
> resolver; so have you also tested with a non-c-ares build?
> If it only occures with c-ares then this is only an issue with this lib,
> but not with libcurl.

How can I know? I have compiled plain vanilla with mingw.
I presume that Features: AsynchDNS is standard windows resolver. That's
what Daniel wrote as first reply.

I have built now c-ares 1.9.1 with 'mingw32-make -f Makefile.m32' and
tried to compile curl against it:

1. Added #define HTTP_ONLY and uncommented #define USE_ARES in
config-win32.h
2. Set LIBCARES_PATH=E:\Downloads\c-ares-1.9.1
3. Finally compiled curl with mingw32-make mingw32-winssl-ares

But the linking fails with:
gcc -s -shared -o libcurl.dll \
   -Wl,--output-def,libcurl.def,--out-implib,libcurldll.a \
   file.o timeval.o base64.o hostip.o progress.o formdata.o cookie.o
http.o sendf.o ftp.o url.o dict.o if2ip.o speedcheck
.o ldap.o ssluse.o version.o getenv.o escape.o mprintf.o telnet.o
netrc.o getinfo.o transfer.o strequal.o easy.o securit
y.o krb4.o curl_fnmatch.o fileinfo.o ftplistparser.o wildcard.o krb5.o
memdebug.o http_chunks.o strtok.o connect.o llist
.o hash.o multi.o content_encoding.o share.o http_digest.o md4.o md5.o
curl_rand.o http_negotiate.o inet_pton.o strtooff
t.o strerror.o amigaos.o hostasyn.o hostip4.o hostip6.o hostsyn.o
inet_ntop.o parsedate.o select.o gtls.o sslgen.o tftp.
o splay.o strdup.o socks.o ssh.o nss.o qssl.o rawstr.o curl_addrinfo.o
socks_gssapi.o socks_sspi.o curl_sspi.o slist.o n
onblock.o curl_memrchr.o imap.o pop3.o smtp.o pingpong.o rtsp.o
curl_threads.o warnless.o hmac.o polarssl.o curl_rtmp.o
openldap.o curl_gethostname.o gopher.o axtls.o idn_win32.o
http_negotiate_sspi.o cyassl.o http_proxy.o non-ascii.o asyn-
ares.o asyn-thread.o curl_gssapi.o curl_ntlm.o curl_ntlm_wb.o
curl_ntlm_core.o curl_ntlm_msgs.o curl_sasl.o curl_schanne
l.o curl_multibyte.o curl_darwinssl.o hostcheck.o bundles.o conncache.o
libcurl.res -L"E:\Downloads\c-ares-1.9.1" -lcare
s -lwldap32 -lws2_32
version.o: In function `curl_version':
E:\Downloads\curl-7.29.0\lib/version.c:93: undefined reference to
`_imp__ares_version'
version.o: In function `curl_version_info':
E:\Downloads\curl-7.29.0\lib/version.c:312: undefined reference to
`_imp__ares_version'
asyn-ares.o: In function `waitperform':
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:263: undefined reference to
`_imp__ares_getsock'
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:296: undefined reference to
`_imp__ares_process_fd'
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:291: undefined reference to
`_imp__ares_process_fd'
asyn-ares.o: In function `Curl_resolver_global_init':
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:106: undefined reference to
`_imp__ares_library_init'
asyn-ares.o: In function `Curl_resolver_global_cleanup':
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:122: undefined reference to
`_imp__ares_library_cleanup'
asyn-ares.o: In function `Curl_resolver_init':
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:135: undefined reference to
`_imp__ares_init'
asyn-ares.o: In function `Curl_resolver_cleanup':
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:156: undefined reference to
`_imp__ares_destroy'
asyn-ares.o: In function `Curl_resolver_duphandle':
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:169: undefined reference to
`_imp__ares_dup'
asyn-ares.o: In function `Curl_resolver_cancel':
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:182: undefined reference to
`_imp__ares_cancel'
asyn-ares.o: In function `Curl_resolver_getsock':
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:227: undefined reference to
`_imp__ares_getsock'
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:233: undefined reference to
`_imp__ares_timeout'
asyn-ares.o: In function `Curl_resolver_is_resolved':
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:330: undefined reference to
`_imp__ares_strerror'
asyn-ares.o: In function `Curl_resolver_wait_resolv':
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:365: undefined reference to
`_imp__ares_timeout'
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:407: undefined reference to
`_imp__ares_cancel'
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:432: undefined reference to
`_imp__ares_strerror'
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:437: undefined reference to
`_imp__ares_strerror'
asyn-ares.o: In function `Curl_resolver_getaddrinfo':
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:604: undefined reference to
`_imp__ares_gethostbyname'
asyn-ares.o: In function `Curl_set_dns_servers':
E:\Downloads\curl-7.29.0\lib/asyn-ares.c:618: undefined reference to
`_imp__ares_set_servers_csv'
collect2.exe: error: ld returned 1 exit status
Makefile.m32:275: recipe for target 'libcurl.dll' failed
mingw32-make[1]: *** [libcurl.dll] Error 1
mingw32-make[1]: Leaving directory 'E:/Downloads/curl-7.29.0/lib'
Makefile:87: recipe for target 'mingw32-winssl-ares' failed
mingw32-make: *** [mingw32-winssl-ares] Error 2

4. Read INSTALL of c-ares and noticed that Makefile.m32 misses
-DCARES_STATICLIB in FLAGS.
5. Added them manually and got a bit further but still fail with:

E:\Downloads\c-ares-1.9.1/libcares.a(ares_process.o):ares_process.c:(.text+0xd62):
undefined reference to `_imp__ares_ex
pand_name'
E:\Downloads\c-ares-1.9.1/libcares.a(ares_process.o):ares_process.c:(.text+0xe35):
undefined reference to `_imp__ares_ex
pand_name'
c:/programme/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe:
E:\Downloads\c-ares-1.9.1/libcares.a(are
s_process.o): bad reloc address 0x20 in section `.eh_frame'
collect2.exe: error: ld returned 1 exit status
Makefile.m32:275: recipe for target 'libcurl.dll' failed
mingw32-make[1]: *** [libcurl.dll] Error 1
mingw32-make[1]: Leaving directory 'E:/Downloads/curl-7.29.0/lib'
Makefile:87: recipe for target 'mingw32-winssl-ares' failed
mingw32-make: *** [mingw32-winssl-ares] Error 2

What now?

Thanks,

Michael
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-04-01