Subject: Re: how to deal with libc vs. libresolve discrepancies?
To: NetBSD User-Level Technical Discussion List <tech-userlevel@NetBSD.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: tech-userlevel
Date: 12/19/2006 14:32:52
On Mon, Dec 18, 2006 at 01:01:58PM -0500, Greg A. Woods wrote:
> configure:3906: checking for pcap_lookupdev in -lpcap
> configure:3939: cc -o conftest -O2 -mno-soft-float -mcpu=21164a -g -mieee -pipe -mieee -I/usr/include -I/usr/include -static -L/usr/lib -Wl,-R/usr/pkg/lib conftest.c -lpcap  -lm -lresolv  >&5
> /usr/lib/libc.a(res_query.o): In function `res_querydomain':
> /building/work/woods/m-NetBSD-1.6/lib/libc/net/res_query.c:331: multiple definition of `res_querydomain'
> /usr/lib/libresolv.a(res_query.o):/building/work/woods/m-NetBSD-1.6/lib/libresolv/../libc/net/res_query.c:331: first defined here
> ld: Warning: size of symbol `res_querydomain' changed from 448 to 496 in res_query.o
> /usr/lib/libc.a(res_mkquery.o): In function `__res_opt':
> /building/work/woods/m-NetBSD-1.6/lib/libc/net/res_mkquery.c:208: multiple definition of `__res_opt'
> /usr/lib/libresolv.a(res_mkquery.o):/building/work/woods/m-NetBSD-1.6/lib/libresolv/../libc/net/res_mkquery.c:208: first defined here

Just guessing. libc is requesting a symbol from res_query.o, which is
not also provided by libresolv.a, therefore pulling in both objects.
That's a known problem and limitation of static linking.

Joerg