From 017678433caae358b1782a2438b10e1ed510a8ad Mon Sep 17 00:00:00 2001 From: Chris Metcalf Date: Tue, 30 Oct 2012 14:14:33 -0400 Subject: Suppress incorrect link warnings for NSS symbols When glibc is built with --enable-static-nss, the warning that using NSS symbols requires the nss shared objects to be present is no longer true, as those symbols are built into libc. Suppress the warning for those symbols by providing a new macro (nss_interface_function) for the NSS functions that is defined as static_link_warning in the normal case, and empty for static NSS. --- nss/nsswitch.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'nss/nsswitch.h') diff --git a/nss/nsswitch.h b/nss/nsswitch.h index 047a9e5858..0cf67ff025 100644 --- a/nss/nsswitch.h +++ b/nss/nsswitch.h @@ -107,6 +107,14 @@ enum /* Flags whether custom rules for database is set. */ extern bool __nss_database_custom[NSS_DBSIDX_max]; +/* Warning for NSS functions, which don't require dlopen if glibc + was built with --enable-static-nss. */ +#ifdef DO_STATIC_NSS +# define nss_interface_function(name) +#else +# define nss_interface_function(name) static_link_warning (name) +#endif + /* Interface functions for NSS. */ -- cgit 1.4.1