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)