Discussion:
static libcurl warnings
Arthur Murray
2012-01-12 19:29:40 UTC
Permalink
Compiling my linux static app against a static libcurl results in:

libcurl.a(netrc.o): In function `Curl_parsenetrc':
netrc.c:(.text+0x3af): warning: Using 'getpwuid' in statically linked
applications requires at runtime the shared libraries from the glibc
version used for linking

libcurl.a(curl_addrinfo.o): In function `Curl_getaddrinfo_ex':
curl_addrinfo.c:(.text+0x30e): warning: Using 'getaddrinfo' in
statically linked applications requires at runtime the shared
libraries from the glibc version used for linking

I use libcurl compiled with c-ares. Is there anything I should be
doing to get rid of the causes of these warnings so the binary is
portable? I know they are only warnings, but are non-portable
getpwuid and getaddrinfo absolutely necessary?
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Daniel Stenberg
2012-01-12 22:16:54 UTC
Permalink
curl_addrinfo.c:(.text+0x30e): warning: Using 'getaddrinfo' in statically
linked applications requires at runtime the shared libraries from the glibc
version used for linking
I use libcurl compiled with c-ares.
Ouch. It really should not have any code included that uses getaddrinfo() when
c-ares is used... I've just pushed a commit to the git repo that removes it
from the build in this case:

https://github.com/bagder/curl/commit/9f20379fe445d
Is there anything I should be doing to get rid of the causes of these
warnings so the binary is portable? I know they are only warnings, but are
non-portable getpwuid and getaddrinfo absolutely necessary?
getpwuid is used by the .netrc parser code and there's no build time option to
disable that, although you can of course just edit the source code to not use
it.
--
/ daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Dan Fandrich
2012-01-13 00:47:57 UTC
Permalink
Post by Daniel Stenberg
Is there anything I should be doing to get rid of the causes of
these warnings so the binary is portable? I know they are only
warnings, but are non-portable getpwuid and getaddrinfo absolutely
necessary?
getpwuid is used by the .netrc parser code and there's no build time
option to disable that, although you can of course just edit the
source code to not use it.
You can always statically link against a libc other than glibc--there
are several to choose from these days.
Post by Daniel Stenberg
Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Loading...