Smack: add the execute lable to ldconfig
[platform/upstream/glibc.git] / Makeconfig
index 42b836e..a22181c 100644 (file)
@@ -1,5 +1,4 @@
-# Copyright (C) 1991-2003,2004,2005,2006,2007,2008,2009,2010,2011,2012
-#      Free Software Foundation, Inc.
+# Copyright (C) 1991-2015 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -33,31 +32,6 @@ ifdef subdir
 .. := ../
 endif
 
-# If config.make exists, the source directory was configured,
-# so don't try to be clever and find another directory to build in.
-ifneq (,$(wildcard $(..)config.make))
-ARCH =
-machine =
-else   # Not configured.
-ifndef ARCH
-ifdef machine
-ARCH = $(machine)
-endif # machine
-endif # ARCH
-endif # config.make
-
-# Directory for object files and libc.a.  If this is not defined, the
-# object files live in the subdirectories where their sources live, and
-# libc.a lives in the parent directory (this probably doesn't work any
-# more).
-ifdef ARCH
-ifeq ($(filter /%,$(ARCH)),)
-objdir := $(..)$(ARCH)
-else
-objdir = $(ARCH)
-endif
-endif
-
 # $(common-objdir) is the place to put objects and
 # such that are not specific to a single subdir.
 ifdef objdir
@@ -65,15 +39,7 @@ objpfx := $(patsubst %//,%/,$(objdir)/$(subdir)/)
 common-objpfx = $(objdir)/
 common-objdir = $(objdir)
 else
-objpfx :=
-ifdef ..
-common-objpfx = $(..)
-common-objdir = ..
-else
-# This is a kludge.  make wizards might grok.
-common-objpfx = sysdeps/../
-common-objdir = .
-endif
+objdir must be defined by the build-directory Makefile.
 endif
 
 # Root of the sysdeps tree.
@@ -120,14 +86,18 @@ $(common-objpfx)config.make: $(common-objpfx)config.status \
 $(common-objpfx)config.status: $(..)version.h $(..)configure \
                               $(foreach dir,$(sysdirs),\
                                         $(wildcard $(dir)/Implies) \
-                                        $(patsubst %.in,%,\
+                                        $(patsubst %.ac,%,\
                                                    $(firstword $(wildcard \
- $(addprefix $(dir)/,configure configure.in))))) \
-                              $(patsubst %.in,%,\
+ $(addprefix $(dir)/,configure configure.ac))))) \
+                              $(patsubst %.ac,%,\
+ $(wildcard $(..)sysdeps/*/preconfigure $(..)sysdeps/*/preconfigure.ac)) \
+                              $(patsubst %.ac,%,\
                                          $(foreach add-on,$(add-ons),\
                                                    $(firstword $(wildcard \
  $(addprefix $(firstword $(filter /%,$(add-on)) $(..)$(add-on))/,\
-            configure configure.in)))))
+            configure configure.ac))) \
+ $(wildcard $(addprefix $(firstword $(filter /%,$(add-on)) $(..)$(add-on))/,\
+                       sysdeps/*/preconfigure sysdeps/*/preconfigure.ac))))
        @cd $(@D); if test -f $(@F); then exec $(SHELL) $(@F) --recheck; else \
         echo The GNU C library has not been configured. >&2; \
         echo Run \`configure\' to configure it before building. >&2; \
@@ -181,12 +151,18 @@ libdir = $(exec_prefix)/lib
 endif
 inst_libdir = $(install_root)$(libdir)
 
-# Where to install the shared library and dynamic linker.
+# Where to install the shared library.
 ifndef slibdir
 slibdir = $(exec_prefix)/lib
 endif
 inst_slibdir = $(install_root)$(slibdir)
 
+# Where to install the dynamic linker.
+ifndef rtlddir
+rtlddir = $(slibdir)
+endif
+inst_rtlddir = $(install_root)$(rtlddir)
+
 # Prefix to put on files installed in $(libdir).  For libraries `libNAME.a',
 # the prefix is spliced between `lib' and the name, so the linker switch
 # `-l$(libprefix)NAME' finds the library; for other files the prefix is
@@ -283,7 +259,7 @@ inst_sysconfdir = $(install_root)$(sysconfdir)
 
 # Directory for the database files and Makefile for nss_db.
 ifndef vardbdir
-vardbdir = $(localstatedir)/db
+vardbdir = /var/lib/misc
 endif
 inst_vardbdir = $(install_root)$(vardbdir)
 
@@ -411,26 +387,10 @@ LDFLAGS.so += $(hashstyle-LDFLAGS)
 LDFLAGS-rtld += $(hashstyle-LDFLAGS)
 endif
 
-# Commands for linking programs with the C library.
-ifndef +link
-+link-before-libc = $(CC) -nostdlib -nostartfiles -o $@ \
-             $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
-             $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
-             $(addprefix $(csu-objpfx),$(start-installed-name)) \
-             $(+preinit) $(+prector) \
-             $(filter-out $(addprefix $(csu-objpfx),start.o \
-                                                    $(start-installed-name))\
-                          $(+preinit) $(link-extra-libs) \
-                          $(common-objpfx)libc% $(+postinit),$^) \
-             $(link-extra-libs)
-+link-after-libc = $(+postctor) $(+postinit)
-+link = $(+link-before-libc) $(link-libc) $(+link-after-libc)
-+link-tests = $(+link-before-libc) $(link-libc-tests) $(+link-after-libc)
-endif
 # Command for linking PIE programs with the C library.
 ifndef +link-pie
-+link-pie = $(CC) -pie -Wl,-O1 -nostdlib -nostartfiles -o $@ \
-            $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
++link-pie-before-libc = $(CC) -pie -Wl,-O1 -nostdlib -nostartfiles -o $@ \
+            $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
             $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
             $(addprefix $(csu-objpfx),S$(start-installed-name)) \
             $(+preinit) $(+prectorS) \
@@ -438,7 +398,12 @@ ifndef +link-pie
                                                    S$(start-installed-name))\
                          $(+preinit) $(link-extra-libs) \
                          $(common-objpfx)libc% $(+postinit),$^) \
-            $(link-extra-libs) $(link-libc) $(+postctorS) $(+postinit)
+            $(link-extra-libs)
++link-pie-after-libc = $(+postctorS) $(+postinit)
++link-pie = $(+link-pie-before-libc) $(rtld-LDFLAGS) $(link-libc) \
+           $(+link-pie-after-libc)
++link-pie-tests = $(+link-pie-before-libc) $(rtld-tests-LDFLAGS) \
+                 $(link-libc-tests) $(+link-pie-after-libc)
 endif
 # Command for statically linking programs with the C library.
 ifndef +link-static
@@ -450,28 +415,46 @@ ifndef +link-static
                                                     $(start-installed-name))\
                           $(+preinit) $(link-extra-libs-static) \
                           $(common-objpfx)libc% $(+postinit),$^) \
-             $(link-extra-libs-static) $(link-libc-static)
+             $(link-extra-libs-static)
 +link-static-after-libc = $(+postctorT) $(+postinit)
 +link-static = $(+link-static-before-libc) $(link-libc-static) \
               $(+link-static-after-libc)
 +link-static-tests = $(+link-static-before-libc) $(link-libc-static-tests) \
                     $(+link-static-after-libc)
 endif
-# Command for statically linking bounded-pointer programs with the C library.
-ifndef +link-bounded
-+link-bounded = $(CC) -nostdlib -nostartfiles -static -fbounded-pointers -o $@ \
-             $(sysdep-LDFLAGS) $(LDFLAGS)  \
-             $(addprefix $(csu-objpfx),b$(static-start-installed-name)) \
-             $(+preinit) $(+prectorT) \
-             $(filter-out $(addprefix $(csu-objpfx),start.ob \
+# Commands for linking programs with the C library.
+ifndef +link
+ifeq (yes,$(build-shared))
++link-before-libc = $(CC) -nostdlib -nostartfiles -o $@ \
+             $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
+             $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
+             $(addprefix $(csu-objpfx),$(start-installed-name)) \
+             $(+preinit) $(+prector) \
+             $(filter-out $(addprefix $(csu-objpfx),start.o \
                                                     $(start-installed-name))\
-                          $(+preinit) $(link-extra-libs-bounded) \
+                          $(+preinit) $(link-extra-libs) \
                           $(common-objpfx)libc% $(+postinit),$^) \
-             $(link-extra-libs-bounded) $(link-libc-bounded) $(+postctorT) $(+postinit)
+             $(link-extra-libs)
++link-after-libc = $(+postctor) $(+postinit)
++link = $(+link-before-libc) $(rtld-LDFLAGS) $(link-libc) \
+       $(+link-after-libc)
++link-tests = $(+link-before-libc) $(rtld-tests-LDFLAGS) \
+             $(link-libc-tests) $(+link-after-libc)
+else
++link = $(+link-static)
++link-tests = $(+link-static-tests)
+endif
 endif
-ifndef config-LDFLAGS
 ifeq (yes,$(build-shared))
-config-LDFLAGS = -Wl,-dynamic-linker=$(slibdir)/$(rtld-installed-name)
+ifndef rtld-LDFLAGS
+rtld-LDFLAGS = -Wl,-dynamic-linker=$(rtlddir)/$(rtld-installed-name)
+endif
+ifndef rtld-tests-LDFLAGS
+ifeq (yes,$(build-hardcoded-path-in-tests))
+rtld-tests-LDFLAGS = -Wl,-dynamic-linker=$(elf-objpfx)ld.so
+else
+rtld-tests-LDFLAGS = $(rtld-LDFLAGS)
+endif
 endif
 endif
 ifndef link-libc
@@ -479,20 +462,24 @@ ifeq (yes,$(build-shared))
 # We need the versioned name of libc.so in the deps of $(others) et al
 # so that the symlink to libc.so is created before anything tries to
 # run the linked programs.
-link-libc-before-gnulib = -Wl,-rpath-link=$(rpath-link) \
-           $(common-objpfx)libc.so$(libc.so-version) \
-           $(common-objpfx)$(patsubst %,$(libtype.oS),c) \
-           $(as-needed) $(common-objpfx)elf/ld.so $(no-as-needed)
-link-libc = $(link-libc-before-gnulib) $(gnulib)
-link-libc-tests = $(link-libc-before-gnulib) $(gnulib-tests)
+link-libc-rpath-link = -Wl,-rpath-link=$(rpath-link)
+ifeq (yes,$(build-hardcoded-path-in-tests))
+link-libc-tests-rpath-link = -Wl,-rpath=$(rpath-link)
+else
+link-libc-tests-rpath-link = $(link-libc-rpath-link)
+endif
+link-libc-before-gnulib = $(common-objpfx)libc.so$(libc.so-version) \
+                         $(common-objpfx)$(patsubst %,$(libtype.oS),c) \
+                         $(as-needed) $(elf-objpfx)ld.so \
+                         $(no-as-needed)
+link-libc = $(link-libc-rpath-link) $(link-libc-before-gnulib) $(gnulib)
+link-libc-tests = $(link-libc-tests-rpath-link) \
+                 $(link-libc-before-gnulib) $(gnulib-tests)
 # This is how to find at build-time things that will be installed there.
 rpath-dirs = math elf dlfcn nss nis rt resolv crypt
 rpath-link = \
 $(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$(common-objpfx)%)))
-elfobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)elf)
 else
-nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
-resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
 link-libc = $(common-objpfx)libc.a $(otherlibs) $(gnulib) $(common-objpfx)libc.a $(gnulib)
 link-libc-tests = $(common-objpfx)libc.a $(otherlibs) $(gnulib-tests) $(common-objpfx)libc.a $(gnulib-tests)
 endif
@@ -515,13 +502,11 @@ endif
 ifndef link-extra-libs
 link-extra-libs = $(LDLIBS-$(@F))
 link-extra-libs-static = $(link-extra-libs)
-link-extra-libs-bounded = $(link-extra-libs)
 endif
 
 # The static libraries.
 link-libc-static = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib) -Wl,--end-group
 link-libc-static-tests = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib-tests) -Wl,--end-group
-link-libc-bounded = $(common-objpfx)libc_b.a $(gnulib) $(common-objpfx)libc_b.a
 
 # How to link against libgcc.  Some libgcc functions, such as those
 # for "long long" arithmetic or software floating point, can always be
@@ -568,7 +553,14 @@ gnulib-arch =
 gnulib = -lgcc $(gnulib-arch)
 gnulib-tests := -lgcc $(libgcc_eh)
 static-gnulib-arch =
+# By default, elf/static-stubs.o, instead of -lgcc_eh, is used to
+# statically link programs.  When --disable-shared is used, we use
+# -lgcc_eh since elf/static-stubs.o isn't sufficient.
+ifeq (yes,$(build-shared))
 static-gnulib = -lgcc $(static-gnulib-arch)
+else
+static-gnulib = -lgcc -lgcc_eh $(static-gnulib-arch)
+endif
 static-gnulib-tests := -lgcc -lgcc_eh $(libunwind)
 libc.so-gnulib := -lgcc
 endif
@@ -586,37 +578,148 @@ endif
 csu-objpfx = $(common-objpfx)csu/
 elf-objpfx = $(common-objpfx)elf/
 
+# A command that, prepended to the name and arguments of a program,
+# and run on the build system, causes that program with those
+# arguments to be run on the host for which the library is built.
+ifndef test-wrapper
+test-wrapper =
+endif
+# Likewise, but the name of the program is preceded by
+# <variable>=<value> assignments for environment variables.
+ifndef test-wrapper-env
+test-wrapper-env = $(test-wrapper) env
+endif
+
+# Whether to run test programs built for the library's host system.
+ifndef run-built-tests
+ifeq (yes|,$(cross-compiling)|$(test-wrapper))
+run-built-tests = no
+else
+run-built-tests = yes
+endif
+endif
+
+# Whether to stop immediately when a test fails.  Nonempty means to
+# stop, empty means not to stop.
+ifndef stop-on-test-failure
+stop-on-test-failure =
+endif
+
 # How to run a program we just linked with our library.
 # The program binary is assumed to be $(word 2,$^).
 built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^))
+rtld-prefix = $(elf-objpfx)$(rtld-installed-name)                            \
+             --library-path                                                  \
+             $(rpath-link)$(patsubst %,:%,$(sysdep-library-path))
 ifeq (yes,$(build-shared))
 comma = ,
 sysdep-library-path = \
 $(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
                                       $(filter -Wl$(comma)-rpath-link=%,\
                                                $(sysdep-LDFLAGS)))))
-run-program-prefix = $(if $(filter $(notdir $(built-program-file)),\
-                                  $(tests-static) $(xtests-static)),, \
-                         $(elf-objpfx)$(rtld-installed-name) \
-                         --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)))
+# $(run-via-rtld-prefix) is a command that, when prepended to the name
+# of a program built with the newly built library, produces a command
+# that, executed on the host for which the library is built, runs that
+# program.  For tests listed in tests-static or xtests-static, it is
+# empty.
+run-via-rtld-prefix =                                                        \
+  $(if $(strip $(filter $(notdir $(built-program-file)),                     \
+                       $(tests-static) $(xtests-static))),, $(rtld-prefix))
 else
-run-program-prefix =
-endif
-# Never use $(run-program-prefix) for the statically-linked %-bp test programs
-built-program-cmd = $(patsubst %,$(run-program-prefix),\
-                       $(filter-out %-bp,$(built-program-file))) \
-                   $(built-program-file)
+run-via-rtld-prefix =
+endif
+# $(run-program-env) is the default environment variable settings to
+# use when running a program built with the newly built library.
+run-program-env = GCONV_PATH=$(common-objpfx)iconvdata \
+                 LOCPATH=$(common-objpfx)localedata LC_ALL=C
+# $(run-program-prefix) is a command that, when prepended to the name
+# of a program built with the newly built library, produces a command
+# that, executed on the build system on which "make" is run, runs that
+# program.  $(run-program-prefix-before-env) and
+# $(run-program-prefix-after-env) are similar, but separate parts
+# before and after a list of environment variables.
+run-program-prefix-before-env = $(test-wrapper-env)
+run-program-prefix-after-env = $(run-via-rtld-prefix)
+run-program-prefix = $(run-program-prefix-before-env) $(run-program-env) \
+                    $(run-program-prefix-after-env)
+# $(built-program-cmd) is a command that, executed on the build system
+# on which "make" is run, runs the newly built program that is the
+# second dependency of the makefile target in which
+# $(built-program-cmd) is used.  $(built-program-cmd-before-env) and
+# $(built-program-cmd-after-env) are similar, before and after a list
+# of environment variables.
+built-program-cmd-before-env = $(test-wrapper-env)
+built-program-cmd-after-env = $(run-via-rtld-prefix) $(built-program-file)
+built-program-cmd = $(built-program-cmd-before-env) $(run-program-env) \
+                   $(built-program-cmd-after-env)
+# $(host-built-program-cmd) is a command that, executed on the host
+# for which the library is built, runs the newly built program that is
+# the second dependency of the makefile target in which
+# $(host-built-program-cmd) is used.
+host-built-program-cmd = $(run-via-rtld-prefix) $(built-program-file)
 
 ifndef LD
 LD := ld -X
 endif
 
+# $(test-via-rtld-prefix) is a command that, when prepended to the name
+# of a test program built with the newly built library, produces a command
+# that, executed on the host for which the library is built, runs that
+# program.  For tests listed in tests-static or xtests-static as well
+# as when test programs are hardcoded to the newly built libraries, it
+# is empty.
+
+# $(test-program-prefix) is a command that, when prepended to the name
+# of a test program built with the newly built library, produces a command
+# that, executed on the build system on which "make" is run, runs that
+# test program.  $(test-program-prefix-before-env) and
+# $(test-program-prefix-after-env) are similar, before and after a
+# list of environment variables.
+
+# $(test-program-cmd) is a command that, executed on the build system
+# on which "make" is run, runs the newly built test program that is the
+# second dependency of the makefile target in which
+# $(test-program-cmd) is used.  $(test-program-cmd-before-env) and
+# $(test-program-cmd-after-env) are similar, before and after a list
+# of environment variables.
+
+# $(host-test-program-cmd) is a command that, executed on the host
+# for which the library is built, runs the newly built test program that
+# is the second dependency of the makefile target in which
+# $(host-test-program-cmd) is used.
+
+ifeq (yes,$(build-hardcoded-path-in-tests))
+test-via-rtld-prefix =
+test-program-prefix-before-env = $(test-wrapper-env)
+test-program-prefix-after-env =
+test-program-prefix = $(test-program-prefix-before-env) $(run-program-env) \
+                     $(test-program-prefix-after-env)
+test-program-cmd-before-env = $(test-wrapper-env)
+test-program-cmd-after-env = $(built-program-file)
+test-program-cmd = $(test-program-cmd-before-env) $(run-program-env) \
+                  $(test-program-cmd-after-env)
+host-test-program-cmd = $(built-program-file)
+else
+test-via-rtld-prefix = $(run-via-rtld-prefix)
+test-program-prefix-before-env = $(run-program-prefix-before-env)
+test-program-prefix-after-env = $(run-program-prefix-after-env)
+test-program-prefix = $(run-program-prefix)
+test-program-cmd-before-env = $(built-program-cmd-before-env)
+test-program-cmd-after-env = $(built-program-cmd-after-env)
+test-program-cmd = $(built-program-cmd)
+host-test-program-cmd = $(host-built-program-cmd)
+endif
+
 # Extra flags to pass to GCC.
 ifeq ($(all-warnings),yes)
 +gccwarn := -Wall -Wwrite-strings -Winline -Wcast-qual -Wbad-function-cast -Wmissing-noreturn -Wmissing-prototypes -Wmissing-declarations -Wcomment -Wcomments -Wtrigraphs -Wsign-compare -Wfloat-equal -Wmultichar
 else
 +gccwarn := -Wall -Wwrite-strings -Winline
 endif
++gccwarn += -Wundef
+ifeq ($(enable-werror),yes)
++gccwarn += -Werror -Wno-error=undef
+endif
 +gccwarn-c = -Wstrict-prototypes
 
 # We do not depend on the address of constants in different files to be
@@ -693,11 +796,18 @@ endif     # $(+cflags) == ""
 # Don't duplicate options if we inherited variables from the parent.
 +cflags        := $(sort $(+cflags))
 
+# Each sysdeps directory can contain header files that both will be
+# used to compile and will be installed.  Each can also contain an
+# include/ subdirectory, whose header files will be used to compile
+# but will not be installed, and will take precedence over the
+# installed files.  This mirrors the top-level include/ subdirectory.
++sysdep-includes := $(foreach dir,$(+sysdep_dirs),\
+                             $(addprefix -I,$(wildcard $(dir)/include) $(dir)))
+
 # These are flags given to the C compiler to tell it to look for
 # include files (including ones given in angle brackets) in the parent
 # library source directory, in the include directory, and in the
 # current directory.
-+sysdep-includes = $(addprefix -I,$(+sysdep_dirs))
 +includes = -I$(..)include $(if $(subdir),$(objpfx:%/=-I%)) \
            $(+sysdep-includes) $(includes) \
            $(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes)
@@ -706,12 +816,37 @@ endif     # $(+cflags) == ""
 # of many little headers in the include directory.
 libio-include = -I$(..)libio
 
+# List of non-library modules that we build.
+built-modules = iconvprogs iconvdata ldconfig lddlibc4 libmemusage \
+               libSegFault libpcprofile librpcsvc locale-programs \
+               memusagestat nonlib nscd extramodules libnldbl
+
+# We don't include libc-modules.h when these targets are being built.  These
+# targets don't (and will likely never need to) use the IS_IN facility.  In
+# fact, shlib-versions should not use it because that will create a circular
+# dependency as libc-modules.h is generated from shlib-versions.
+skip-module-cppflags = shlib-versions.v.i Versions.v.i
+
+in-module = $(subst -,_,$(firstword $(libof-$(basename $(@F))) \
+                                   $(libof-$(<F)) \
+                                   $(libof-$(@F)) \
+                                   libc))
+
+module-cppflags-real = -include $(common-objpfx)libc-modules.h \
+                      -DMODULE_NAME=$(in-module)
+
+# We don't need libc-modules.h and the MODULE_NAME definition for
+# shlib-version.v.i.
+module-cppflags = $(if $(filter $(@F),$(skip-module-cppflags)), \
+                      ,$(module-cppflags-real))
+
 # These are the variables that the implicit compilation rules use.
 # Note that we can't use -std=* in CPPFLAGS, because it overrides
 # the implicit -lang-asm and breaks cpp behavior for .S files--notably
 # it causes cpp to stop predefining __ASSEMBLER__.
-CPPFLAGS = $(CPPUNDEFS) $(CPPFLAGS-config) $($(subdir)-CPPFLAGS) \
-          $(+includes) $(defines) \
+CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
+          $($(subdir)-CPPFLAGS) \
+          $(+includes) $(defines) $(module-cppflags) \
           -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
           $(CPPFLAGS-$(suffix $@)) \
           $(foreach lib,$(libof-$(basename $(@F))) \
@@ -738,7 +873,7 @@ endif
 # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
 # to pass different flags for each flavor.
 libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
-all-object-suffixes := .o .os .op .og .ob .oS
+all-object-suffixes := .o .os .op .og .oS
 object-suffixes :=
 CPPFLAGS-.o = $(pic-default)
 CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
@@ -773,18 +908,6 @@ endif
 # differently from the rest.
 object-suffixes-noshared := $(filter-out .os,$(object-suffixes))
 
-bppfx = BP-
-ifeq (yes,$(build-bounded))
-# Under --enable-bounded, we build the library with `-fbounded-pointers -g'
-# to runtime bounds checking.  The bounded-pointer objects are named foo.ob.
-# We disable sibling-call optimizations so that stack traces will be complete
-# and thus aid debugging, since after all, BPs are a debugging tool.
-object-suffixes += .ob
-CPPFLAGS-.ob = -fbounded-pointers $(pic-default)
-CFLAGS-.ob = -g -O2 -fno-optimize-sibling-calls -fno-strict-aliasing
-libtype.ob = lib%_b.a
-endif
-
 object-suffixes-for-libc := $(object-suffixes)
 
 ifeq (yes,$(build-shared))
@@ -816,8 +939,6 @@ subdirs = $(sorted-subdirs)
 subdir-srcdirs = $(foreach dir,$(subdirs),\
                           $(firstword $($(dir)-srcdir) $(..)$(dir)))
 
-ifeq (yes, $(build-shared))
-
 # This is a pair of implicit rules to preprocess a file with # comments,
 # %ifdef et al, based on config.h settings or other %include'd files.
 # We use chained rules instead of a pipeline here so that we can properly
@@ -836,6 +957,8 @@ ifeq (yes, $(build-shared))
        sed '/^[        ]*#/d;/^[       ]*$$/d' $< > $@T
        mv -f $@T $@
 
+ifeq (yes, $(build-shared))
+
 # To generate a header to support more than one ABI for different
 # architecture variants, the CPU/Makefile defines abi-variants to be a
 # list of names for those variants (e.g. 32 64), and, for each variant,
@@ -862,26 +985,18 @@ $(common-objpfx)shlib-versions.v.i: \
                   $(subdir-srcdirs:=/shlib-versions)) \
        $(..)shlib-versions
 
-soversions-default-setname = $(patsubst %, %,\
-                                       $(filter-out %_default,\
-                                                    $(oldest-abi:%=GLIBC_%)))
 $(common-objpfx)soversions.i: $(..)scripts/soversions.awk \
                              $(common-objpfx)shlib-versions.v
-       $(AWK) -v default_setname='$(soversions-default-setname)' \
-              -v cpu='$(config-machine)' \
-              -v vendor='$(config-vendor)' \
-              -v os='$(config-os)' \
-              -f $^ > $@T
+       $(AWK) -f $^ > $@T
        mv -f $@T $@
 $(common-objpfx)soversions.mk: $(common-objpfx)soversions.i $(..)Makeconfig
        (while read which lib number setname; do \
           eval seen_$$which=1; \
-          test x"$$which" != xABI || echo abi-name = "$$lib"; \
           test x"$$which" = xDEFAULT || continue; \
           case $$number in \
             [0-9]*) echo "$$lib.so-version=.$$number"; \
                     echo "all-sonames+=$$lib=$$lib.so\$$($$lib.so-version)";;\
-            *)      echo "$$lib.so-version=\$$(if \$$(abi-$(default-abi)-$$lib-soname),\$$(abi-$(default-abi)-$$lib-soname),$$number)"; \
+            *)      echo "$$lib.so-version=$$number"; \
                     echo "all-sonames+=$$lib=\$$($$lib.so-version)";;\
           esac; \
         done; \
@@ -893,44 +1008,22 @@ endif
 postclean-generated += soversions.mk soversions.i \
                       shlib-versions.v shlib-versions.v.i
 
-# Generate the header containing the names of all shared libraries.
-# We use a stamp file to avoid unnecessary recompilations.
-before-compile += $(common-objpfx)gnu/lib-names.h
+before-compile += $(common-objpfx)libc-modules.h
 ifeq ($(soversions.mk-done),t)
-$(common-objpfx)gnu/lib-names.h: $(common-objpfx)gnu/lib-names.stmp; @:
-$(common-objpfx)gnu/lib-names.stmp: $(..)scripts/lib-names.awk \
-                                   $(common-objpfx)soversions.i
-       $(make-target-directory)
-       { \
-        echo '/* This file is automatically generated.';\
-        echo '   It defines macros to allow user program to find the shared'; \
-        echo '   library files which come as part of GNU libc.  */'; \
-        echo '#ifndef __GNU_LIB_NAMES_H'; \
-        echo '#define __GNU_LIB_NAMES_H        1'; \
-        echo ''; \
-        $(if $(abi-includes), \
-         $(foreach h,$(abi-includes), echo '#include <$(h)>';) \
-         echo '';) \
-        $(if $(abi-variants), \
-        $(foreach v,$(abi-variants),\
-        $(if $(abi-$(v)-condition),\
-        echo '#if $(abi-$(v)-condition)'; \
-        ($(foreach s,$(all-sonames), \
-          $(if $(abi-$(v)-$(firstword $(subst =, ,$(s)))-soname),\
-            echo $(firstword $(subst =, ,$(s)))=$(abi-$(v)-$(firstword $(subst =, ,$(s)))-soname);, \
-            echo $(s);))) \
-        | LC_ALL=C $(AWK) -v multi=1 -f $(firstword $^) | LC_ALL=C sort;) \
-        $(if $(abi-$(v)-condition),echo '#endif';)), \
-        ($(foreach s,$(all-sonames), echo $(s);)) \
-        | LC_ALL=C $(AWK) -f $(firstword $^) | LC_ALL=C sort;) \
-        echo ''; \
-        echo '#endif   /* gnu/lib-names.h */'; \
-       } >  ${@:stmp=T}
+# Generate a header with macro definitions for use with the IS_IN macro.
+# These are the possible values for the MODULE_NAME macro defined when building
+# sources, to identify which module the translation unit is going to be built
+# into.
+$(common-objpfx)libc-modules.h: $(common-objpfx)libc-modules.stmp; @:
+$(common-objpfx)libc-modules.stmp: $(..)scripts/gen-libc-modules.awk \
+                                  $(common-objpfx)soversions.i
+       $(AWK) -v buildlist="$(subst -,_,$(built-modules))" -f $^ > ${@:stmp=T}
        $(move-if-change) ${@:stmp=T} ${@:stmp=h}
        touch $@
+
 endif
 
-common-generated += gnu/lib-names.h gnu/lib-names.stmp
+common-generated += libc-modules.h libc-modules.stmp
 
 # The name under which the run-time dynamic linker is installed.
 # We are currently going for the convention that `/lib/ld.so.1'
@@ -969,13 +1062,19 @@ all-subdirs = csu assert ctype locale intl catgets math setjmp signal        \
              stdlib stdio-common libio malloc string wcsmbs time dirent    \
              grp pwd posix io termios resource misc socket sysvipc gmon    \
              gnulib iconv iconvdata wctype manual shadow gshadow po argp   \
-             crypt nss localedata timezone rt conform debug                \
+             crypt localedata timezone rt conform debug                    \
              $(add-on-subdirs) dlfcn elf
 
 ifndef avoid-generated
-all-Depend-files := $(wildcard $(foreach dir,$(all-subdirs),\
-                                        $(firstword $($(dir)-srcdir) \
-                                                    $(..)$(dir))/Depend))
+# sysd-sorted itself will contain rules making the sysd-sorted target
+# depend on Depend files.  But if you just added a Depend file to an
+# existing directory not in all-subdirs, then sysd-sorted needs to
+# be regenerated, so it depends on existing $(sorted-subdirs:=/Depend) files.
+all-Depend-files := $(wildcard $(sort \
+                       $(foreach dir,$(all-subdirs),\
+                                 $(firstword $($(dir)-srcdir) \
+                                 $(..)$(dir))/Depend) \
+                       $(sorted-subdirs:=/Depend)))
 $(common-objpfx)sysd-sorted: $(..)scripts/gen-sorted.awk \
                             $(common-objpfx)config.make $(..)Makeconfig \
                             $(wildcard $(sysdirs:=/Subdirs)) \
@@ -1011,6 +1110,20 @@ defines += -D_LIBC_REENTRANT
 libio-mtsafe = -D_IO_MTSAFE_IO
 endif
 
+# The name to give to a test in test results summaries.
+test-name = $(strip $(patsubst %.out, %, $(patsubst $(common-objpfx)%, %, $@)))
+
+# Likewise, in XFAIL variable names.
+test-xfail-name = $(strip $(patsubst %.out, %, $(patsubst $(objpfx)%, %, $@)))
+
+# Command to output a test status line (such as PASS: test-name).  If
+# test-xfail-$(test-xfail-name) has a nonempty value, the status will be
+# XPASS or XFAIL rather than PASS or FAIL.
+evaluate-test = $(..)scripts/evaluate-test.sh $(test-name) $$? \
+                 $(if $(test-xfail-$(test-xfail-name)),true,false) \
+                 $(if $(stop-on-test-failure),true,false) \
+                 > $(common-objpfx)$(test-name).test-result
+
 endif # Makeconfig not yet included
 
 # Local Variables: