aboutsummaryrefslogtreecommitdiff
path: root/htl/Makefile
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-06-10 20:03:52 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-06-10 21:34:19 +0000
commitbc9cf8fbe8eafe375719ad869ab81609cfc3529c (patch)
tree9734a4e576acea9e3e5f5ba17d88f3156fc6357d /htl/Makefile
parent533dd2acf7eefa969fb770fa782b20519bd4bc0f (diff)
downloadglibc-bc9cf8fbe8eafe375719ad869ab81609cfc3529c.tar
glibc-bc9cf8fbe8eafe375719ad869ab81609cfc3529c.tar.gz
glibc-bc9cf8fbe8eafe375719ad869ab81609cfc3529c.tar.bz2
glibc-bc9cf8fbe8eafe375719ad869ab81609cfc3529c.zip
htl: Fix linking static tests by factorizing the symbols list
libpthread_syms.a will contain the symbols that libc tries to get from libpthread, to be used by the system, but also by tests. * htl/libpthread.a, htl/libpthread_pic.a: Link libpthread_syms.a and Move EXTERN references to... * htl/libpthread_syms.a: ... new file. Add missing __pthread_enable_asynccancel reference. * htl/Makefile: Install libpthread_syms.a and link it into static tests.
Diffstat (limited to 'htl/Makefile')
-rw-r--r--htl/Makefile10
1 files changed, 7 insertions, 3 deletions
diff --git a/htl/Makefile b/htl/Makefile
index 2de98e1774..c424bd512b 100644
--- a/htl/Makefile
+++ b/htl/Makefile
@@ -173,6 +173,7 @@ static-only-routines = pt-atfork
extra-libs := libpthread
extra-libs-others := $(extra-libs)
install-lib := libpthread.so
+install-lib-ldscripts := libpthread_syms.a
include ../Makeconfig
@@ -180,7 +181,7 @@ CFLAGS-lockfile.c = -D_IO_MTSAFE_IO
all: # Make this the default target; it will be defined in Rules.
-subdir_install: $(inst_libdir)/libpthread2.a
+subdir_install: $(inst_libdir)/libpthread2.a $(inst_libdir)/libpthread_syms.a
# XXX: If $(inst_libdir)/libpthread2.a is installed and
# $(inst_libdir)/libpthread is not, we can have some issues.
@@ -198,6 +199,9 @@ $(inst_libdir)/libpthread2_pic.a: $(inst_libdir)/libpthread_pic.a
mv $< $@
$(INSTALL_DATA) $(srcdir)/libpthread_pic.a $<
+$(inst_libdir)/libpthread_syms.a: $(srcdir)/libpthread_syms.a $(+force)
+ $(do-install)
+
libc-link.so = $(common-objpfx)libc.so
extra-B-pthread.so = -B$(common-objpfx)htl/
@@ -217,7 +221,7 @@ $(objpfx)tst-unload: $(libdl)
$(addprefix $(objpfx), $(tests-reverse)): \
$(objpfx)../libc.so $(objpfx)libpthread.so
$(objpfx)../libc.so: $(common-objpfx)libc.so ;
-$(addprefix $(objpfx),$(tests-static) $(xtests-static)): $(objpfx)libpthread.a
+$(addprefix $(objpfx),$(tests-static) $(xtests-static)): $(srcdir)/libpthread_syms.a $(objpfx)libpthread.a
else
-$(addprefix $(objpfx),$(tests) $(test-srcs)): $(objpfx)libpthread.a
+$(addprefix $(objpfx),$(tests) $(test-srcs)): $(srcdir)/libpthread_syms.a $(objpfx)libpthread.a
endif