From patchwork Fri May 21 12:46:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 43530 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6962F398B89C; Fri, 21 May 2021 12:46:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6962F398B89C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1621601179; bh=+hCMguhrRhEGs0B+g3YtikHSEHwhwwQZD3eTshSPeUs=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=bNCWzxtQoTe4keOQor94clu8A26K7Vaxv1HiWJwp+ZBJKKL3MiKxeMMM6/iB9oHoD VnFdZoeUY2euv44w/HiS9DjTwhQ/z/Q1u9iUKPpQkNJO2MYJ4HOu/WfrkwQ5fkQEZS ksTEPr28PGKwXZLTtTQGQe8Qa7Da2ndJ30ypqL08= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 53BA8398B873 for ; Fri, 21 May 2021 12:46:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 53BA8398B873 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-410-hC6akFrzNVazkKBt3mBPiw-1; Fri, 21 May 2021 08:46:12 -0400 X-MC-Unique: hC6akFrzNVazkKBt3mBPiw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0C1C71018F7F for ; Fri, 21 May 2021 12:46:12 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-228.ams2.redhat.com [10.36.113.228]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6543662665 for ; Fri, 21 May 2021 12:46:11 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 7/8] nptl: Do not install libpthread.so and do not link tests with it In-Reply-To: References: X-From-Line: e9d228ad5eb41c16b006f46a10b88750569b51fe Mon Sep 17 00:00:00 2001 Message-Id: Date: Fri, 21 May 2021 14:46:09 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK 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: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Keep installing libpthread.a, so that -lpthread works. Reviewed-by: Adhemerval Zanella --- nptl/Makefile | 30 +++++------------------------- sysdeps/nptl/Makeconfig | 8 ++++++-- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/nptl/Makefile b/nptl/Makefile index 64cd0dcbf6..52d1d193d9 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -204,12 +204,15 @@ routines = \ unwind \ vars \ -shared-only-routines = forward static-only-routines = pthread_atfork - libpthread-routines = libpthread-compat libpthread-shared-only-routines = libpthread-compat +# Pretend that libpthread.so is a linker script, so that the symbolic +# link is not installed. +install-lib-ldscripts = libpthread.so +$(inst_libdir)/libpthread.so: + # Since cancellation handling is in large parts handled using exceptions # we have to compile some files with exception handling enabled, some # even with asynchronous unwind tables. @@ -374,8 +377,6 @@ else tests-printers-libs := $(static-thread-library) endif -LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete - tests += tst-cancelx7 tst-cancelx17 ifeq ($(build-shared),yes) @@ -469,7 +470,6 @@ ifeq (yes,$(build-shared)) lib-noranlib: $(addprefix $(objpfx),$(extra-objs)) endif - # 'pthread_self' is a simple memory or register load. Setting up the # stack frame is more work than the actual operation. Disable the # frame creation entirely. This will help applications which call the @@ -548,35 +548,15 @@ else librt = $(common-objpfx)rt/librt.a endif -# `make check' sometimes triggers a rebuild of librt.so using this Makefile, -# which ignores librt's dependence on libpthread -$(common-objpfx)rt/librt.so: $(shared-thread-library) - $(objpfx)tst-cancel17: $(librt) $(objpfx)tst-cancelx17: $(librt) LDLIBS-tst-cancel24 = -Wl,--no-as-needed -lstdc++ LDLIBS-tst-cancel24-static = $(LDLIBS-tst-cancel24) -# 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) $(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 -ifeq ($(build-shared),yes) generated += multidir.mk tst-tls6.out endif diff --git a/sysdeps/nptl/Makeconfig b/sysdeps/nptl/Makeconfig index 8757ec868b..8a9407925c 100644 --- a/sysdeps/nptl/Makeconfig +++ b/sysdeps/nptl/Makeconfig @@ -21,7 +21,11 @@ have-thread-library = yes -shared-thread-library = $(common-objpfx)nptl/libpthread.so -static-thread-library = $(common-objpfx)nptl/libpthread.a +# The thread library is integrated. +shared-thread-library = +static-thread-library = +# Some tests need this to load their own test objects, and system +# libraries used by memusagestat need to link against the empty +# libpthread.so.0, not the (potentially non-empty) system version. rpath-dirs += nptl