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