From patchwork Wed Jun 10 21:37:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1307235 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49j0hQ6Y1hz9sRK for ; Thu, 11 Jun 2020 07:37:42 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 44BBB393C897; Wed, 10 Jun 2020 21:37:39 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from hera.aquilenet.fr (hera.aquilenet.fr [IPv6:2a0c:e300::1]) by sourceware.org (Postfix) with ESMTPS id 31581388F043 for ; Wed, 10 Jun 2020 21:37:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 31581388F043 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=samuel.thibault@ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 66EDD54B5; Wed, 10 Jun 2020 23:37:34 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OKjjUI6m8HJL; Wed, 10 Jun 2020 23:37:32 +0200 (CEST) Received: from function.home (lfbn-bor-1-797-11.w86-234.abo.wanadoo.fr [86.234.239.11]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 4E54985BD; Wed, 10 Jun 2020 23:37:32 +0200 (CEST) Received: from samy by function.home with local (Exim 4.93) (envelope-from ) id 1jj8Pb-005bWQ-Ln; Wed, 10 Jun 2020 23:37:31 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Subject: [hurd, commited 1/2] htl: Fix linking static tests by factorizing the symbols list Date: Wed, 10 Jun 2020 23:37:30 +0200 Message-Id: <20200610213731.1335828-2-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200610213731.1335828-1-samuel.thibault@ens-lyon.org> References: <20200610213731.1335828-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: commit-hurd@gnu.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" 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. --- htl/Makefile | 10 +++++++--- htl/libpthread.a | 22 +--------------------- htl/libpthread_pic.a | 22 +--------------------- htl/libpthread_syms.a | 21 +++++++++++++++++++++ 4 files changed, 30 insertions(+), 45 deletions(-) create mode 100644 htl/libpthread_syms.a 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 diff --git a/htl/libpthread.a b/htl/libpthread.a index e5bd2cc229..cfc1893b2b 100644 --- a/htl/libpthread.a +++ b/htl/libpthread.a @@ -1,22 +1,2 @@ -/* pthread initializer is weak in glibc. It must be included if glibc - is to start threading. */ -EXTERN(_cthread_init_routine) - -/* Weak references in glibc that must be filled if glibc is to be - thread safe. */ -EXTERN(cthread_detach) -EXTERN(cthread_fork) -EXTERN(cthread_keycreate) -EXTERN(cthread_getspecific) -EXTERN(cthread_setspecific) -EXTERN(__mutex_lock_solid) -EXTERN(__mutex_unlock_solid) -/* For libio stream locking. */ -EXTERN(_cthreads_flockfile) -EXTERN(_cthreads_funlockfile) -EXTERN(_cthreads_ftrylockfile) -/* To get the sigthread stack layout on fork */ -EXTERN(pthread_getattr_np) -EXTERN(pthread_attr_getstack) - +GROUP(-lpthread_syms) GROUP(-lpthread2 -lrt) diff --git a/htl/libpthread_pic.a b/htl/libpthread_pic.a index 33346b4b39..8794ac6dab 100644 --- a/htl/libpthread_pic.a +++ b/htl/libpthread_pic.a @@ -1,22 +1,2 @@ -/* pthread initializer is weak in glibc. It must be included if glibc - is to start threading. */ -EXTERN(_cthread_init_routine) - -/* Weak references in glibc that must be filled if glibc is to be - thread safe. */ -EXTERN(cthread_detach) -EXTERN(cthread_fork) -EXTERN(cthread_keycreate) -EXTERN(cthread_getspecific) -EXTERN(cthread_setspecific) -EXTERN(__mutex_lock_solid) -EXTERN(__mutex_unlock_solid) -/* For libio stream locking. */ -EXTERN(_cthreads_flockfile) -EXTERN(_cthreads_funlockfile) -EXTERN(_cthreads_ftrylockfile) -/* To get the sigthread stack layout on fork */ -EXTERN(pthread_getattr_np) -EXTERN(pthread_attr_getstack) - +GROUP(-lpthread_syms) GROUP(-lpthread2_pic) diff --git a/htl/libpthread_syms.a b/htl/libpthread_syms.a new file mode 100644 index 0000000000..3801ec93c8 --- /dev/null +++ b/htl/libpthread_syms.a @@ -0,0 +1,21 @@ +/* pthread initializer is weak in glibc. It must be included if glibc + is to start threading. */ +EXTERN(_cthread_init_routine) + +/* Weak references in glibc that must be filled if glibc is to be + thread safe. */ +EXTERN(cthread_detach) +EXTERN(cthread_fork) +EXTERN(cthread_keycreate) +EXTERN(cthread_getspecific) +EXTERN(cthread_setspecific) +EXTERN(__mutex_lock_solid) +EXTERN(__mutex_unlock_solid) +/* For libio stream locking. */ +EXTERN(_cthreads_flockfile) +EXTERN(_cthreads_funlockfile) +EXTERN(_cthreads_ftrylockfile) +/* To get the sigthread stack layout on fork */ +EXTERN(pthread_getattr_np) +EXTERN(pthread_attr_getstack) +EXTERN(__pthread_enable_asynccancel) From patchwork Wed Jun 10 21:37:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1307236 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49j0hV6ScPz9sRK for ; Thu, 11 Jun 2020 07:37:46 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9BEC2393C89E; Wed, 10 Jun 2020 21:37:39 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from hera.aquilenet.fr (hera.aquilenet.fr [IPv6:2a0c:e300::1]) by sourceware.org (Postfix) with ESMTPS id 31CB43893673 for ; Wed, 10 Jun 2020 21:37:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 31CB43893673 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=samuel.thibault@ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 6A9D685BD; Wed, 10 Jun 2020 23:37:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LjNmdghvM5Lw; Wed, 10 Jun 2020 23:37:33 +0200 (CEST) Received: from function.home (lfbn-bor-1-797-11.w86-234.abo.wanadoo.fr [86.234.239.11]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 582298C61; Wed, 10 Jun 2020 23:37:32 +0200 (CEST) Received: from samy by function.home with local (Exim 4.93) (envelope-from ) id 1jj8Pb-005bWU-Mh; Wed, 10 Jun 2020 23:37:31 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Subject: [hurd,commited 2/2] htl: Enable more cancel tests Date: Wed, 10 Jun 2020 23:37:31 +0200 Message-Id: <20200610213731.1335828-3-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200610213731.1335828-1-samuel.thibault@ens-lyon.org> References: <20200610213731.1335828-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: commit-hurd@gnu.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" * nptl/tst-cancel11.c, tst-cancel21-static.c, tst-cancel21.c, tst-cancel6.c, tst-cancelx11.c, tst-cancelx21.c, tst-cancelx6.c: Move to... * sysdeps/pthread: ... here. * nptl/Makefile: Move corresponding references and rules to... * sysdeps/pthread/Makefile: ... here. --- nptl/Makefile | 17 +++++++---------- sysdeps/pthread/Makefile | 17 +++++++++++------ {nptl => sysdeps/pthread}/tst-cancel11.c | 0 {nptl => sysdeps/pthread}/tst-cancel21-static.c | 0 {nptl => sysdeps/pthread}/tst-cancel21.c | 0 {nptl => sysdeps/pthread}/tst-cancel6.c | 0 {nptl => sysdeps/pthread}/tst-cancelx11.c | 0 {nptl => sysdeps/pthread}/tst-cancelx21.c | 0 {nptl => sysdeps/pthread}/tst-cancelx6.c | 0 9 files changed, 18 insertions(+), 16 deletions(-) rename {nptl => sysdeps/pthread}/tst-cancel11.c (100%) rename {nptl => sysdeps/pthread}/tst-cancel21-static.c (100%) rename {nptl => sysdeps/pthread}/tst-cancel21.c (100%) rename {nptl => sysdeps/pthread}/tst-cancel6.c (100%) rename {nptl => sysdeps/pthread}/tst-cancelx11.c (100%) rename {nptl => sysdeps/pthread}/tst-cancelx21.c (100%) rename {nptl => sysdeps/pthread}/tst-cancelx6.c (100%) diff --git a/nptl/Makefile b/nptl/Makefile index 55cd147f8c..c431ead1c0 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -278,8 +278,8 @@ tests = tst-attr2 tst-attr3 tst-default-attr \ tst-sem17 \ tst-tsd3 tst-tsd4 \ tst-cancel4 tst-cancel4_1 tst-cancel4_2 tst-cancel5 \ - tst-cancel6 tst-cancel7 tst-cancel9 tst-cancel11 tst-cancel13 \ - tst-cancel16 tst-cancel17 tst-cancel20 tst-cancel21 tst-cancel24 \ + tst-cancel7 tst-cancel9 tst-cancel13 \ + tst-cancel16 tst-cancel17 tst-cancel20 tst-cancel24 \ tst-cancel-self tst-cancel-self-cancelstate \ tst-cleanup4 \ tst-signal3 \ @@ -358,9 +358,9 @@ endif LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst -tests += tst-cancelx4 tst-cancelx5 tst-cancelx6 tst-cancelx7 tst-cancelx9 \ - tst-cancelx11 tst-cancelx13 \ - tst-cancelx16 tst-cancelx17 tst-cancelx20 tst-cancelx21 \ +tests += tst-cancelx4 tst-cancelx5 tst-cancelx7 tst-cancelx9 \ + tst-cancelx13 \ + tst-cancelx16 tst-cancelx17 tst-cancelx20 \ tst-cleanupx4 ifeq ($(build-shared),yes) @@ -422,11 +422,11 @@ link-libc-static := $(common-objpfx)libc.a $(static-gnulib) \ $(common-objpfx)libc.a tests-static += tst-stackguard1-static \ - tst-cancel21-static tst-cancel24-static \ + tst-cancel24-static \ tst-mutex8-static tst-mutexpi8-static tst-sem11-static \ tst-sem12-static tst-cond11-static -tests += tst-cancel21-static tst-cancel24-static +tests += tst-cancel24-static tests-internal += tst-sem11-static tst-sem12-static tst-stackguard1-static xtests-static += tst-setuid1-static @@ -477,15 +477,12 @@ CFLAGS-tst-cancelx5.c += -Wno-error # implementation. For this we have to pass the -fexceptions parameter. CFLAGS-tst-cancelx4.c += -fexceptions CFLAGS-tst-cancelx5.c += -fexceptions -CFLAGS-tst-cancelx6.c += -fexceptions CFLAGS-tst-cancelx7.c += -fexceptions CFLAGS-tst-cancelx9.c += -fexceptions -CFLAGS-tst-cancelx11.c += -fexceptions CFLAGS-tst-cancelx13.c += -fexceptions CFLAGS-tst-cancelx16.c += -fexceptions CFLAGS-tst-cancelx17.c += -fexceptions CFLAGS-tst-cancelx20.c += -fexceptions -fasynchronous-unwind-tables -CFLAGS-tst-cancelx21.c += -fexceptions -fasynchronous-unwind-tables CFLAGS-tst-cleanupx4.c += -fexceptions CFLAGS-tst-cleanupx4aux.c += -fexceptions CFLAGS-tst-initializers1.c += -W -Wall -Werror diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile index 8d094b2221..a8e83d9d16 100644 --- a/sysdeps/pthread/Makefile +++ b/sysdeps/pthread/Makefile @@ -52,8 +52,10 @@ tests += tst-cnd-basic tst-mtx-trylock tst-cnd-broadcast \ tst-basic1 tst-basic2 tst-basic3 tst-basic4 tst-basic5 tst-basic6 \ tst-basic7 \ tst-cancel-self-canceltype tst-cancel-self-testcancel \ - tst-cancel1 tst-cancel2 tst-cancel3 tst-cancel8 tst-cancel10 \ + tst-cancel1 tst-cancel2 tst-cancel3 \ + tst-cancel6 tst-cancel8 tst-cancel10 tst-cancel11 \ tst-cancel12 tst-cancel14 tst-cancel15 tst-cancel18 tst-cancel19 \ + tst-cancel21 \ tst-cancel22 tst-cancel23 tst-cancel26 tst-cancel27 tst-cancel28 \ tst-cleanup0 tst-cleanup1 tst-cleanup2 tst-cleanup3 \ tst-clock1 \ @@ -113,8 +115,9 @@ tests-nolibpthread = tst-unload CFLAGS-tst-cleanup2.c += -fno-builtin CFLAGS-tst-cleanupx2.c += -fno-builtin -tests += tst-cancelx2 tst-cancelx3 tst-cancelx8 tst-cancelx10 \ - tst-cancelx12 tst-cancelx14 tst-cancelx15 tst-cancelx18 \ +tests += tst-cancelx2 tst-cancelx3 tst-cancelx6 tst-cancelx8 tst-cancelx10 \ + tst-cancelx11 tst-cancelx12 tst-cancelx14 tst-cancelx15 \ + tst-cancelx18 tst-cancelx21 \ tst-cleanupx0 tst-cleanupx1 tst-cleanupx2 tst-cleanupx3 ifeq ($(build-shared),yes) @@ -133,10 +136,9 @@ ifeq ($(build-shared),yes) tests: $(test-modules) endif -tests-static += tst-locale1 tst-locale2 - -tests += tst-cond11-static +tests-static += tst-locale1 tst-locale2 tst-cancel21-static \ +tests += tst-cancel21-static tst-cond11-static # These tests are linked with libc before libpthread tests-reverse += tst-cancel23 tst-vfork1x tst-vfork2x @@ -151,12 +153,15 @@ endif # implementation. For this we have to pass the -fexceptions parameter. CFLAGS-tst-cancelx2.c += -fexceptions CFLAGS-tst-cancelx3.c += -fexceptions +CFLAGS-tst-cancelx6.c += -fexceptions CFLAGS-tst-cancelx8.c += -fexceptions CFLAGS-tst-cancelx10.c += -fexceptions +CFLAGS-tst-cancelx11.c += -fexceptions CFLAGS-tst-cancelx12.c += -fexceptions CFLAGS-tst-cancelx14.c += -fexceptions CFLAGS-tst-cancelx15.c += -fexceptions CFLAGS-tst-cancelx18.c += -fexceptions +CFLAGS-tst-cancelx21.c += -fexceptions -fasynchronous-unwind-tables CFLAGS-tst-cleanupx0.c += -fexceptions -fasynchronous-unwind-tables CFLAGS-tst-cleanupx1.c += -fexceptions -fasynchronous-unwind-tables CFLAGS-tst-cleanupx2.c += -fexceptions diff --git a/nptl/tst-cancel11.c b/sysdeps/pthread/tst-cancel11.c similarity index 100% rename from nptl/tst-cancel11.c rename to sysdeps/pthread/tst-cancel11.c diff --git a/nptl/tst-cancel21-static.c b/sysdeps/pthread/tst-cancel21-static.c similarity index 100% rename from nptl/tst-cancel21-static.c rename to sysdeps/pthread/tst-cancel21-static.c diff --git a/nptl/tst-cancel21.c b/sysdeps/pthread/tst-cancel21.c similarity index 100% rename from nptl/tst-cancel21.c rename to sysdeps/pthread/tst-cancel21.c diff --git a/nptl/tst-cancel6.c b/sysdeps/pthread/tst-cancel6.c similarity index 100% rename from nptl/tst-cancel6.c rename to sysdeps/pthread/tst-cancel6.c diff --git a/nptl/tst-cancelx11.c b/sysdeps/pthread/tst-cancelx11.c similarity index 100% rename from nptl/tst-cancelx11.c rename to sysdeps/pthread/tst-cancelx11.c diff --git a/nptl/tst-cancelx21.c b/sysdeps/pthread/tst-cancelx21.c similarity index 100% rename from nptl/tst-cancelx21.c rename to sysdeps/pthread/tst-cancelx21.c diff --git a/nptl/tst-cancelx6.c b/sysdeps/pthread/tst-cancelx6.c similarity index 100% rename from nptl/tst-cancelx6.c rename to sysdeps/pthread/tst-cancelx6.c