The attached patch lets glibc build static versions of libnss_{files,dns}, too. This enables statically linked binaries to use /etc/hosts and the like. Reproducible: Always Steps to Reproduce:
Created attachment 18043 [details, diff] sys-libs/glibc-2.3.2-r1: use --enable-static-nss
Forget this patch for now. --enable-static-nss is broken and likely not to be fixed by the glibc maintainers: http://www.geocrawler.com/archives/3/360/1998/12/0/1999096/ http://lists.nas.nasa.gov/archives/ext/linux-security-audit/2001/02/msg00062.html http://www.gnu.org/software/libc/FAQ.html#s-2.22 Even the linker call given in the FAQ does not work... I'll have to swallow the bitter pill and include the libnss_{files,dns}.so* files in initrds and chroots. :(
Closing since it's a glibc problem Gentoo can't fix (easily).