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

Re: Problem with nsswitch and new libc



On Wed, Nov 08, 2000 at 10:59:28PM -0600, Sam TH wrote:
> On Mon, Nov 06, 2000 at 07:12:11PM -0500, Ben Collins wrote:
> > On Mon, Nov 06, 2000 at 05:15:02PM -0600, Sam TH wrote:
> > > Recently, I upgraded my system (running woody) to the newest libc.  This caused static
> > > compilation of AbiWord (of which I am a developer) to break.  I don't ever compile
> > > things statically otherwise, so this is the only thing broken.  However, since the errors, 
> > > which look like so:
> > > 
> > > /usr/lib/libc.a(nsswitch.o)(.data+0xd4): undefined reference to `_nss_files_sethostent'
> > > 
> > > do not mention any AbiWord files, and they appeared immediately after the upgrade, I 
> > > suspect this is a libc issue.
> > > 
> > > Has anyone else had this problem?  Is there a fix I should know about?  I was unable to 
> > > find anything in the archives. 
> > 
> > NSS is now compiled statically (i.e. seperate from libc.a), so if your
> > program requires lookup calls (those that work with NSS), then you need to
> > do this:
> > 
> > gcc -o temp temp.c /usr/lib/libc.a -lnss_files -lnss_dns
> > 
> > I might revert this, but then static compilations really aren't static
> > anymore (your static app will still dlopen NSS modules, possibly from a
> > different version of libc).
> 
> I've investigated this further, and it appears that abiword never uses
> NSS. At least, the string "nss" never appears in the code.  Yet it still
> gives the errors I previously reported when I tried to statically link.
> 
> I shouldn't have to change the link line if I don't use those libraries,
> right?  Or is there something I'm missing here?

If it uses anything that looks up a host/IP or username/uid/group/gid,
then it uses NSS. Some examples are getpwnam, getaddrinfo,
getgruid...(lot's more).

Anyway, this s all moot, since the 2.1.97-1 in woody now doesn't have this
problem.

Ben

-- 
 -----------=======-=-======-=========-----------=====------------=-=------
/  Ben Collins  --  ...on that fantastic voyage...  --  Debian GNU/Linux   \
`  bcollins@debian.org  --  bcollins@openldap.org  --  bcollins@linux.com  '
 `---=========------=======-------------=-=-----=-===-======-------=--=---'



Reply to: