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

Re: Problem with nsswitch and new libc



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).

Ben

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



Reply to: