olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh1418978-0.patch

00db10
This patch backports the makefile changes related to the support/
00db10
framework.  It is based on upstream commits
00db10
c23de0aacbeaa7a091609b35764bed931475a16d (support: Introduce new
00db10
subdirectory for test infrastructure) and
00db10
76dcbf42df83c970c13c786d287f1ec69e1b91eb (Expose linking against
00db10
libsupport as make dependency).
00db10
00db10
The actual contents of the support/ subdirectory is kept in a separate
00db10
patch, so that it can be updated separately.
00db10
00db10
diff --git a/Makeconfig b/Makeconfig
00db10
index 1673eea7f2667aae..948c46420193051d 100644
00db10
--- a/Makeconfig
00db10
+++ b/Makeconfig
00db10
@@ -384,6 +384,9 @@ LDFLAGS.so += $(hashstyle-LDFLAGS)
00db10
 LDFLAGS-rtld += $(hashstyle-LDFLAGS)
00db10
 endif
00db10
 
00db10
+# Additional libraries to link into every test.
00db10
+link-extra-libs-tests = $(libsupport)
00db10
+
00db10
 # Command for linking PIE programs with the C library.
00db10
 ifndef +link-pie
00db10
 +link-pie = $(CC) -pie -Wl,-O1 -nostdlib -nostartfiles -o $@ \
00db10
@@ -464,7 +467,7 @@ link-libc-before-gnulib = -Wl,-rpath-link=$(rpath-link) \
00db10
 link-libc = $(link-libc-before-gnulib) $(gnulib)
00db10
 link-libc-tests = $(link-libc-before-gnulib) $(gnulib-tests)
00db10
 # This is how to find at build-time things that will be installed there.
00db10
-rpath-dirs = math elf dlfcn nss nis rt resolv crypt
00db10
+rpath-dirs = math elf dlfcn nss nis rt resolv crypt support
00db10
 rpath-link = \
00db10
 $(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$(common-objpfx)%)))
00db10
 else
00db10
@@ -732,7 +735,7 @@ libio-include = -I$(..)libio
00db10
 # List of non-library modules that we build.
00db10
 built-modules = iconvprogs iconvdata ldconfig lddlibc4 libmemusage \
00db10
 		libSegFault libpcprofile librpcsvc locale-programs \
00db10
-		memusagestat nonlib nscd extramodules libnldbl
00db10
+		memusagestat nonlib nscd extramodules libnldbl libsupport
00db10
 
00db10
 in-module = $(subst -,_,$(firstword $(libof-$(basename $(@F))) \
00db10
 				    $(libof-$(
00db10
@@ -1022,6 +1025,12 @@ else
00db10
 libm = $(common-objpfx)math/libm.a
00db10
 endif
00db10
 
00db10
+ifeq ($(build-shared),yes)
00db10
+libsupport = $(common-objpfx)support/libsupport_nonshared.a
00db10
+else
00db10
+libsupport = $(common-objpfx)support/libsupport.a
00db10
+endif
00db10
+
00db10
 # These are the subdirectories containing the library source.  The order
00db10
 # is more or less arbitrary.  The sorting step will take care of the
00db10
 # dependencies.
00db10
@@ -1029,7 +1038,7 @@ all-subdirs = csu assert ctype locale intl catgets math setjmp signal	    \
00db10
 	      stdlib stdio-common libio malloc string wcsmbs time dirent    \
00db10
 	      grp pwd posix io termios resource misc socket sysvipc gmon    \
00db10
 	      gnulib iconv iconvdata wctype manual shadow gshadow po argp   \
00db10
-	      crypt nss localedata timezone rt conform debug		    \
00db10
+	      crypt nss localedata timezone rt conform debug support	    \
00db10
 	      $(add-on-subdirs) dlfcn elf
00db10
 
00db10
 ifndef avoid-generated
00db10
diff --git a/Rules b/Rules
00db10
index 25a16d1a4f001a95..b18fb12b1711c0fc 100644
00db10
--- a/Rules
00db10
+++ b/Rules
00db10
@@ -142,6 +142,7 @@ endif
00db10
 
00db10
 ifneq "$(strip $(binaries-shared-tests))" ""
00db10
 $(addprefix $(objpfx),$(binaries-shared-tests)): %: %.o \
00db10
+  $(link-extra-libs-tests) \
00db10
   $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
00db10
   $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
00db10
 	$(+link-tests)
00db10
@@ -163,6 +164,7 @@ endif
00db10
 
00db10
 ifneq "$(strip $(binaries-static-tests))" ""
00db10
 $(addprefix $(objpfx),$(binaries-static-tests)): %: %.o \
00db10
+  $(link-extra-libs-tests) \
00db10
   $(sort $(filter $(common-objpfx)lib%,$(link-libc-static-tests))) \
00db10
   $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
00db10
 	$(+link-static-tests)
00db10
diff --git a/extra-lib.mk b/extra-lib.mk
00db10
index af1d6fc888f43d1c..6b87e52db3666cca 100644
00db10
--- a/extra-lib.mk
00db10
+++ b/extra-lib.mk
00db10
@@ -5,6 +5,9 @@
00db10
 # The variable $($(lib)-routines) defines the list of modules
00db10
 # to be included in that library.  A sysdep Makefile can add to
00db10
 # $(lib)-sysdep_routines to include additional modules.
00db10
+#
00db10
+# Libraries listed in $(extra-libs-noinstall) are built, but not
00db10
+# installed.
00db10
 
00db10
 lib := $(firstword $(extra-libs-left))
00db10
 extra-libs-left := $(filter-out $(lib),$(extra-libs-left))
00db10
@@ -28,7 +31,9 @@ extra-objs := $(extra-objs)
00db10
 all-$(lib)-routines := $($(lib)-routines) $($(lib)-sysdep_routines)
00db10
 
00db10
 # Add each flavor of library to the lists of things to build and install.
00db10
+ifeq (,$(filter $(lib), $(extra-libs-noinstall)))
00db10
 install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
00db10
+endif
00db10
 extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
00db10
 			$(patsubst %,%$o,$(filter-out \
00db10
 					   $($(lib)-shared-only-routines),\