From patchwork Sat Jan 4 18:37:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1217617 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=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108447-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="aA3QDYZ0"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47qr9s3ytMz9sP3 for ; Sun, 5 Jan 2020 05:37:52 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; q=dns; s=default; b=FQu 4AAdDT0hMMMg++twEOlpRCh/jAhqWnEojUwFimS+END0B44zuKZJTn/Og7FVB9mr B6X0Z7Pt7IZYSG+rULy3aiUHnTylvnrpZscUQmfBvWaijU5FNQrWDss8LAY/zkA1 WB/mjmlK/CLfpuqZLsz8j1UtdZdqQbFiPVpWPAj8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=default; bh=32X+q8M+i uiOZSXZQQJEQ2m5U04=; b=aA3QDYZ0JmlLm/SRBJckjiC3eCb75+SXvgr3qLIHI hkeQClOzH/V1vXJYp44oPaFLV+GtFIeXF6Ck33FuSn6+b2xVqXOg8Jq6hka8I4hh Ee9UxMfNEZmw28QmSSZeoclL6Q4KMx4w92pxI0i/ig4SiwuIZsC3vjig5yIQj/mn oc= Received: (qmail 25669 invoked by alias); 4 Jan 2020 18:37:46 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 25661 invoked by uid 89); 4 Jan 2020 18:37:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.1 spammy=sk:shared, sk:shared-, libpthreadso, GROUP X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd,commited] htl: Move pthread_atfork to libc_nonshared.a Date: Sat, 4 Jan 2020 19:37:40 +0100 Message-Id: <20200104183740.923936-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 This follows bd60ce86520b ('nptl: Move pthread_atfork to libc_nonshared.a') with the same rationale: there is no non-libpthread equivalent to be used for making linking against libpthread optional. libpthread_nonshared.a is unused after this, so remove it from the build. There is no ABI impact because pthread_atfork was implemented using __register_atfork in libc even before this change. pthread_atfork has to be a weak alias because pthread_* names are not reserved in libc. --- htl/Makefile | 34 +++------------------------------- sysdeps/htl/Makeconfig | 3 +-- sysdeps/htl/pt-atfork.c | 3 ++- 3 files changed, 6 insertions(+), 34 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 3b5c10635d..e091077a28 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -120,7 +120,6 @@ libpthread-routines := pt-attr pt-attr-destroy pt-attr-getdetachstate \ pt-sigstate-destroy \ pt-sigstate \ \ - pt-atfork \ old_pt-atfork \ pt-kill \ pt-getcpuclockid \ @@ -137,8 +136,6 @@ libpthread-routines := pt-attr pt-attr-destroy pt-attr-getdetachstate \ cthreads-compat \ $(SYSDEPS) -libpthread-static-only-routines = pt-atfork - headers := \ pthread.h \ semaphore.h \ @@ -166,8 +163,9 @@ headers := \ distribute := -routines := forward libc_pthread_init alloca_cutoff +routines := forward libc_pthread_init alloca_cutoff pt-atfork shared-only-routines = forward +static-only-routines = pt-atfork extra-libs := libpthread extra-libs-others := $(extra-libs) @@ -204,34 +202,8 @@ extra-B-pthread.so = -B$(common-objpfx)htl/ include ../Rules ifeq (yes,$(build-shared)) -# What we install as libpthread.so for programs to link against is in fact a -# link script. It contains references for the various libraries we need. -# The libpthread.so object is not complete since some functions are only -# defined in libpthread_nonshared.a. -# We need to use absolute paths since otherwise local copies (if they exist) -# of the files are taken by the linker. -install: $(inst_libdir)/libpthread.so - -$(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \ - $(objpfx)libpthread.so$(libpthread.so-version) \ - $(inst_libdir)/$(patsubst %,$(libtype.oS),\ - $(libprefix)pthread) \ - $(+force) - (echo '/* GNU ld script';\ - echo ' Use the shared library, but some functions are only in';\ - echo ' the static library, so try that secondarily. */';\ - cat $<; \ - echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \ - '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\ - ')' \ - ) > $@.new - mv -f $@.new $@ - $(addprefix $(objpfx), \ $(filter-out $(tests-static) $(xtests-static) $(tests-reverse) \ $(tests-nolibpthread), \ - $(tests) $(xtests) $(test-srcs))): $(objpfx)libpthread.so \ - $(objpfx)libpthread_nonshared.a + $(tests) $(xtests) $(test-srcs))): $(objpfx)libpthread.so endif - -generated += libpthread_nonshared.a diff --git a/sysdeps/htl/Makeconfig b/sysdeps/htl/Makeconfig index 3af4c1de35..ad56cc6bd1 100644 --- a/sysdeps/htl/Makeconfig +++ b/sysdeps/htl/Makeconfig @@ -3,8 +3,7 @@ have-thread-library = yes -shared-thread-library = $(common-objpfx)htl/libpthread_nonshared.a \ - $(common-objpfx)htl/libpthread.so +shared-thread-library = $(common-objpfx)htl/libpthread.so static-thread-library = $(common-objpfx)htl/libpthread.a bounded-thread-library = $(static-thread-library) diff --git a/sysdeps/htl/pt-atfork.c b/sysdeps/htl/pt-atfork.c index 4512fe72b6..d547dd58e6 100644 --- a/sysdeps/htl/pt-atfork.c +++ b/sysdeps/htl/pt-atfork.c @@ -22,9 +22,10 @@ #include int -pthread_atfork (void (*prepare) (void), +__pthread_atfork (void (*prepare) (void), void (*parent) (void), void (*child) (void)) { return __register_atfork (prepare, parent, child, __dso_handle); } +weak_alias (__pthread_atfork, pthread_atfork)