This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[patch] Fix linking ldconfig when --enable-static-nss
- From: ppluzhnikov at google dot com (Paul Pluzhnikov)
- To: libc-alpha at sourceware dot org
- Cc: ppluzhnikov at google dot com
- Date: Tue, 12 Jan 2010 17:32:11 -0800 (PST)
- Subject: [patch] Fix linking ldconfig when --enable-static-nss
Greetings,
Configuring glibc with --enable-static-nss causes elf/ldconfig to fail to
link with:
/home/glibc-git/build/libc.a(nsswitch.o):(.data+0x8): undefined reference to `_nss_files_getaliasent_r'
/home/glibc-git/build/libc.a(nsswitch.o):(.data+0x18): undefined reference to `_nss_files_endaliasent'
... etc. ...
(AFAICT, this has been broken since at least glibc-2.3.6)
Attached patchlet fixes that.
Thanks,
--
Paul Pluzhnikov
diff --git a/elf/Makefile b/elf/Makefile
index d57c7fe..1a8d755 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -160,6 +160,11 @@ install-rootsbin += ldconfig
ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon
extra-objs += $(ldconfig-modules:=.o)
+ifeq (yes,$(build-static-nss))
+static-gnulib += $(objdir)/nss/libnss_files.a $(objdir)/resolv/libnss_dns.a \
+ $(objdir)/resolv/libresolv.a
+endif
+
# To find xmalloc.c and xstrdup.c
vpath %.c ../locale/programs