From 620e47bba2d0ab646a8d24b84300bbcfa255a224 Mon Sep 17 00:00:00 2001 From: GNU Libc Maintainers Date: Wed, 19 Apr 2023 22:17:51 +0100 Subject: [PATCH] git-pthread_link_tests Committed for 2.32 commit dd7a8ad7ba25cb2269b306758c7d97d4a95527e6 Author: Samuel Thibault Date: Mon Jun 8 13:32:08 2020 +0200 pthread: Move back linking rules to nptl and htl d6d74ec16 ('htl: Enable more tests') moved the linking rules from nptl/Makefile and htl/Makefile to the shared sysdeps/pthread/Makefile. But e.g. on powerpc some tests are added in sysdeps/powerpc/Makefile, which is included *after* sysdeps/pthread/Makefile, and thus the tests don't get affected by the rules and fail to link. For now let's just copy over the set of rules in both nptl/Makefile and htl/Makefile. * sysdeps/pthread/Makefile: Move libpthread linking rules to... * htl/Makefile: ... here and... * nptl/Makefile: ... there. Gbp-Pq: Topic hurd-i386 Gbp-Pq: Name git-pthread_link_tests.diff --- htl/Makefile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 701ad7f55..29e3fa702 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -204,9 +204,20 @@ extra-B-pthread.so = -B$(common-objpfx)htl/ include ../Rules -ifeq (yes,$(build-shared)) +# Make sure we link with the thread library. +ifeq ($(build-shared),yes) $(addprefix $(objpfx), \ $(filter-out $(tests-static) $(xtests-static) $(tests-reverse) \ $(tests-nolibpthread), \ - $(tests) $(xtests) $(test-srcs))): $(objpfx)libpthread.so + $(tests) $(tests-internal) $(xtests) $(test-srcs) $(tests-container))): \ + $(objpfx)libpthread.so +$(objpfx)tst-unload: $(libdl) +# $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so, +# since otherwise libpthread.so comes before libc.so when linking. +$(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 +else +$(addprefix $(objpfx),$(tests) $(test-srcs)): $(objpfx)libpthread.a endif -- 2.30.2