Since the NSS reorganization in glibc 2.33 the --enable-static-nss
option no longer changes the build: the files and dns services are built
into libc unconditionally, and there is no longer any mechanism to bake
the remaining services into libc.a. After removing the dead
-DSTATIC_NSS define and the <gnu/lib-names.h> include (commits
82b710c1900944ea122a3880f542215948fc023d and
21694014388ad278aa03241800d1f0c0a7127ad1), the option's only remaining
effect was to define DO_STATIC_NSS, which suppresses the static link
warnings on the NSS interface functions in libc.a.
With DO_STATIC_NSS gone, nss_interface_function emits the static link
warning unconditionally; static_nss and build-static-nss are removed
along with the configure option.
tst-nss-static, previously built only when build-static-nss was set, is
now added to tests-static unconditionally so the static NSS path retains
test coverage.
Signed-off-by: Michael Ford <fanquake@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Don't build libraries with profiling information. You may want to
use this option if you don't plan to do profiling.
-'--enable-static-nss'
- Compile static versions of the NSS (Name Service Switch) libraries.
- This is not recommended because it defeats the purpose of NSS; a
- program linked statically with the NSS libraries cannot be
- dynamically reconfigured to use a different name database.
-
'--enable-hardcoded-path-in-tests'
By default, dynamic tests are linked to run with the installed C
library. This option hardcodes the newly built C library path in
The corresponding AArch64-specific functionality that was previously
activated by this flag has been removed as well.
+* The --enable-static-nss configure option has been removed. It had no
+ effect on the build since the NSS reorganization in glibc 2.33; its only
+ remaining behavior was to suppress the link-time warnings on the NSS
+ interface functions in libc.a, which are now emitted unconditionally.
+
Changes to build and runtime requirements:
[Add changes to build and runtime requirements here]
/* Define if _Unwind_Find_FDE should be exported from glibc. */
#undef EXPORT_UNWIND_FIND_FDE
-/* Define if static NSS modules are wanted. */
-#undef DO_STATIC_NSS
-
/* Assume that the compiler supports __builtin_expect.
This macro is necessary for proper compilation of code
shared between GNU libc and GNU gettext projects. */
# Configuration options.
build-shared = @shared@
build-profile = @profile@
-build-static-nss = @static_nss@
cross-compiling = @cross_compiling@
force-install = @force_install@
build-nscd = @build_nscd@
VERSION
mach_interface_list
DEFINES
-static_nss
profile
libc_cv_multidir
test_enable_cet
enable_hidden_plt
enable_bind_now
enable_stack_protector
-enable_static_nss
enable_force_install
enable_maintainer_mode
enable_kernel
--enable-stack-protector=[yes|no|all|strong]
Use -fstack-protector[-all|-strong] to detect glibc
buffer overflows
- --enable-static-nss build static NSS modules [default=no]
--disable-force-install don't force installation of files from this package,
even if they are older than the installed files
--enable-maintainer-mode
*) as_fn_error $? "Not a valid argument for --enable-stack-protector: \"$enable_stack_protector\"" "$LINENO" 5;;
esac
-# Check whether --enable-static-nss was given.
-if test ${enable_static_nss+y}
-then :
- enableval=$enable_static_nss; static_nss=$enableval
-else case e in #(
- e) static_nss=no ;;
-esac
-fi
-
-if test x"$static_nss" = xyes || test x"$shared" = xno; then
- static_nss=yes
- printf "%s\n" "#define DO_STATIC_NSS 1" >>confdefs.h
-
-fi
-
# Check whether --enable-force-install was given.
if test ${enable_force_install+y}
then :
-
VERSION=`sed -n -e 's/^#define VERSION "\([^"]*\)"/\1/p' < $srcdir/version.h`
RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h`
*) AC_MSG_ERROR([Not a valid argument for --enable-stack-protector: "$enable_stack_protector"]);;
esac
-dnl On some platforms we cannot use dynamic loading. We must provide
-dnl static NSS modules.
-AC_ARG_ENABLE([static-nss],
- AS_HELP_STRING([--enable-static-nss],
- [build static NSS modules @<:@default=no@:>@]),
- [static_nss=$enableval],
- [static_nss=no])
-dnl Enable static NSS also if we build no shared objects.
-if test x"$static_nss" = xyes || test x"$shared" = xno; then
- static_nss=yes
- AC_DEFINE(DO_STATIC_NSS)
-fi
-
AC_ARG_ENABLE([force-install],
AS_HELP_STRING([--disable-force-install],
[don't force installation of files from this package, even if they are older than the installed files]),
AC_SUBST(libc_cv_multidir)
AC_SUBST(profile)
-AC_SUBST(static_nss)
AC_SUBST(DEFINES)
Don't build libraries with profiling information. You may want to use
this option if you don't plan to do profiling.
-@item --enable-static-nss
-Compile static versions of the NSS (Name Service Switch) libraries.
-This is not recommended because it defeats the purpose of NSS; a program
-linked statically with the NSS libraries cannot be dynamically
-reconfigured to use a different name database.
-
@item --enable-hardcoded-path-in-tests
By default, dynamic tests are linked to run with the installed C library.
This option hardcodes the newly built C library path in dynamic tests
install-others += $(inst_vardbdir)/Makefile
-# Build static module into libc if requested
libnss_db-inhibit-o = $(filter-out .os,$(object-suffixes))
libnss_compat-inhibit-o = $(filter-out .os,$(object-suffixes))
-ifeq ($(build-static-nss),yes)
tests-static += tst-nss-static
-endif
extra-test-objs += nss_test1.os nss_test2.os nss_test_errno.os \
nss_test_gai_hv2_canonname.os
extern bool __nss_database_custom[NSS_DBSIDX_max] attribute_hidden;
#endif
-/* 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
+/* NSS lookups can load service modules via dlopen at runtime, so a
+ statically linked program still depends on the shared NSS modules
+ matching the libc it was built against. Emit the static link
+ warning on the NSS interface functions accordingly. */
+#define nss_interface_function(name) static_link_warning (name)
/* Interface functions for NSS. */