This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Fix build with --enable-static-nss
- From: Alexey Neyman <stilor at att dot net>
- To: libc-alpha at sourceware dot org
- Date: Tue, 24 Jan 2017 12:23:50 -0800
- Subject: [PATCH] Fix build with --enable-static-nss
- Authentication-results: sourceware.org; auth=none
Hi,
A build failure was reported in Crosstool-NG when glibc is configured
with --enable-static-nss:
https://github.com/crosstool-ng/crosstool-ng/issues/555
The definitions in question are protected by '#ifdef USE_NSCD' while all
their uses are inside '#ifdef USE_NSCD' blocks which are themselves
nested inside a '#ifdef SHARED'.
Patch attached.
Regards,
Alexey.
>From eb4258c65dc30585c6eaf439c1418c0965a5d205 Mon Sep 17 00:00:00 2001
From: Alexey Neyman <stilor@att.net>
Date: Tue, 24 Jan 2017 10:31:40 -0800
Subject: [PATCH] Fix build with --enable-static-nss
* nss/nsswitch.c (nscd_init_cb, is_nscd): add '&& defined SHARED'
to definitions to avoid "defined but not used" error.
Signed-off-by: Alexey Neyman <stilor@att.net>
---
ChangeLog | 5 +++++
nss/nsswitch.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 4f40580..57c7f08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-01-24 Alexey Neyman <stilor@att.net>
+
+ * nss/nsswitch.c (nscd_init_cb, is_nscd): add '&& defined SHARED'
+ to definitions to avoid "defined but not used" error.
+
2017-01-24 James Clarke <jrtc27@jrtc27.com>
[BZ #21053]
diff --git a/nss/nsswitch.c b/nss/nsswitch.c
index 0a65f6a..b164e61 100644
--- a/nss/nsswitch.c
+++ b/nss/nsswitch.c
@@ -94,7 +94,7 @@ static name_database *service_table;
static name_database_entry *defconfig_entries;
-#ifdef USE_NSCD
+#if defined USE_NSCD && defined SHARED
/* Nonzero if this is the nscd process. */
static bool is_nscd;
/* The callback passed to the init functions when nscd is used. */
--
2.9.3