From patchwork Sat Aug 16 00:14:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 118454 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 0AA2F3858C2D for ; Sat, 16 Aug 2025 00:30:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0AA2F3858C2D X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 70DA9385840D for ; Sat, 16 Aug 2025 00:14:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 70DA9385840D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bounce.ens-lyon.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 70DA9385840D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.77.166.138 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755303266; cv=none; b=Gq0Jz5ZDMQzoPyRz0M1KHTdYDXrHMzWvr4yEG4JD0SUxBFVQ4MbTFjcTsaftlFne44TWsethkylJa6QGnGNQC8AGIO/lE8FuW5La90W3jKNfKc5qSmHml+y07Q2c2GMVT/UvYoYT5dyjaSr21xltlz/vMHPdMpx7FhmJZakxopw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755303266; c=relaxed/simple; bh=s+MdfjQmdRZKj4PSf1Jt5nPwFTpq4yMoZHhYMxL2GVI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=eOhMLgKITaLyOixw6JQgU7ieu8wCnfS4hXpI6dt5W58zF1CYDuI3I9jFtl+ztELx88KxtsNSl60QN9yPjY+iklnS/fBYQjvFeKHzQRnBfHye63sS2EImRttdtx2PYPoahdVvVSjIESINXuQphTRia/VQjtRC0YSR/c5NHFfMqOQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 70DA9385840D Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id A630EA49BC; Sat, 16 Aug 2025 02:14:08 +0200 (CEST) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kBioOgc4099V; Sat, 16 Aug 2025 02:14:08 +0200 (CEST) Received: from begin (165.21.205.77.rev.sfr.net [77.205.21.165]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id BF8F2A5E00; Sat, 16 Aug 2025 02:14:07 +0200 (CEST) Received: from samy by begin with local (Exim 4.98.2) (envelope-from ) id 1un4Yg-00000000WyQ-3Shg; Sat, 16 Aug 2025 02:14:06 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd,commited 15/19] htl: move pthread_detach into libc. Date: Sat, 16 Aug 2025 02:14:01 +0200 Message-ID: <20250816001405.126154-16-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250816001405.126154-1-samuel.thibault@ens-lyon.org> References: <20250816001405.126154-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org From: gfleury Message-ID: <20250815181500.107433-16-gfleury@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 5 +++-- htl/pt-detach.c | 10 ++++++++-- sysdeps/htl/pthreadP.h | 2 +- sysdeps/mach/hurd/i386/libc.abilist | 3 +++ sysdeps/mach/hurd/i386/libpthread.abilist | 1 - sysdeps/mach/hurd/x86_64/libc.abilist | 3 +++ sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 - 8 files changed, 19 insertions(+), 8 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 52f784a72d..4982409c77 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -26,7 +26,6 @@ LCLHDRS := libpthread-routines := \ pt-create \ - pt-detach \ pt-exit \ pt-initialize \ pt-join \ @@ -140,6 +139,7 @@ routines := \ pt-condattr-setpshared \ pt-dealloc \ pt-destroy-specific \ + pt-detach \ pt-docancel \ pt-getattr \ pt-getconcurrency \ diff --git a/htl/Versions b/htl/Versions index 4845742fc3..322c09f908 100644 --- a/htl/Versions +++ b/htl/Versions @@ -52,6 +52,7 @@ libc { pthread_condattr_getpshared; pthread_condattr_setclock; pthread_condattr_setpshared; + pthread_detach; pthread_getattr_np; pthread_getconcurrency; pthread_key_create; @@ -200,6 +201,7 @@ libc { GLIBC_2.43 { pthread_cancel; + pthread_detach; pthread_getattr_np; pthread_getconcurrency; pthread_getcpuclockid; @@ -295,7 +297,7 @@ libpthread { pthread_atfork; - pthread_create; pthread_detach; pthread_exit; + pthread_create; pthread_exit; pthread_join; @@ -336,7 +338,6 @@ libpthread { __cthread_detach; __cthread_fork; - __pthread_detach; __pthread_create; __cthread_keycreate; __cthread_getspecific; diff --git a/htl/pt-detach.c b/htl/pt-detach.c index a29b68b4b0..f0d43af7f6 100644 --- a/htl/pt-detach.c +++ b/htl/pt-detach.c @@ -21,6 +21,8 @@ #include #include +#include +#include /* Indicate that the storage for THREAD can be reclaimed when it terminates. */ @@ -71,5 +73,9 @@ __pthread_detach (pthread_t thread) return err; } -weak_alias (__pthread_detach, pthread_detach) -hidden_def (__pthread_detach) +libc_hidden_def (__pthread_detach) +versioned_symbol (libc, __pthread_detach, pthread_detach, GLIBC_2_43); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43) +compat_symbol (libpthread, __pthread_detach, pthread_detach, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index 0deea22e8a..98850e9f1d 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -180,6 +180,7 @@ int __pthread_create (pthread_t *newthread, void __cthread_detach (__cthread_t); int __pthread_detach (pthread_t __threadp); +libc_hidden_proto (__pthread_detach) void __pthread_exit (void *value) __attribute__ ((__noreturn__)); int __pthread_join (pthread_t, void **); int __cthread_keycreate (__cthread_key_t *); @@ -230,7 +231,6 @@ libc_hidden_proto (__pthread_get_cleanup_stack) #if IS_IN (libpthread) hidden_proto (__pthread_create) -hidden_proto (__pthread_detach) #endif #if !defined(__NO_WEAK_PTHREAD_ALIASES) && !IS_IN (libpthread) diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index e795ff5ace..da2ad4ae66 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -73,6 +73,7 @@ GLIBC_2.12 pthread_condattr_getpshared F GLIBC_2.12 pthread_condattr_init F GLIBC_2.12 pthread_condattr_setclock F GLIBC_2.12 pthread_condattr_setpshared F +GLIBC_2.12 pthread_detach F GLIBC_2.12 pthread_equal F GLIBC_2.12 pthread_getattr_np F GLIBC_2.12 pthread_getconcurrency F @@ -2646,6 +2647,7 @@ GLIBC_2.42 uimaxabs F GLIBC_2.42 ulabs F GLIBC_2.42 ullabs F GLIBC_2.43 pthread_cancel F +GLIBC_2.43 pthread_detach F GLIBC_2.43 pthread_getattr_np F GLIBC_2.43 pthread_getconcurrency F GLIBC_2.43 pthread_getcpuclockid F @@ -2720,6 +2722,7 @@ HURD_CTHREADS_0.3 __mutex_lock_solid F HURD_CTHREADS_0.3 __mutex_trylock F HURD_CTHREADS_0.3 __mutex_unlock F HURD_CTHREADS_0.3 __mutex_unlock_solid F +HURD_CTHREADS_0.3 __pthread_detach F HURD_CTHREADS_0.3 __pthread_getattr_np F HURD_CTHREADS_0.3 __spin_lock F HURD_CTHREADS_0.3 __spin_lock_init F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index bfec2a2ad3..094f7de25f 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -19,7 +19,6 @@ GLIBC_2.12 ftrylockfile F GLIBC_2.12 funlockfile F GLIBC_2.12 pthread_atfork F GLIBC_2.12 pthread_create F -GLIBC_2.12 pthread_detach F GLIBC_2.12 pthread_exit F GLIBC_2.12 pthread_join F GLIBC_2.12 pthread_spin_destroy F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index bebf927688..2e7e00773a 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1555,6 +1555,7 @@ GLIBC_2.38 pthread_condattr_getpshared F GLIBC_2.38 pthread_condattr_init F GLIBC_2.38 pthread_condattr_setclock F GLIBC_2.38 pthread_condattr_setpshared F +GLIBC_2.38 pthread_detach F GLIBC_2.38 pthread_equal F GLIBC_2.38 pthread_exit F GLIBC_2.38 pthread_getattr_np F @@ -2328,6 +2329,7 @@ GLIBC_2.42 uimaxabs F GLIBC_2.42 ulabs F GLIBC_2.42 ullabs F GLIBC_2.43 pthread_cancel F +GLIBC_2.43 pthread_detach F GLIBC_2.43 pthread_getattr_np F GLIBC_2.43 pthread_getconcurrency F GLIBC_2.43 pthread_getcpuclockid F @@ -2346,6 +2348,7 @@ HURD_CTHREADS_0.3 __mutex_lock_solid F HURD_CTHREADS_0.3 __mutex_trylock F HURD_CTHREADS_0.3 __mutex_unlock F HURD_CTHREADS_0.3 __mutex_unlock_solid F +HURD_CTHREADS_0.3 __pthread_detach F HURD_CTHREADS_0.3 __pthread_getattr_np F HURD_CTHREADS_0.3 __spin_lock F HURD_CTHREADS_0.3 __spin_lock_init F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 9164c479a1..926d31b9cf 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -37,7 +37,6 @@ GLIBC_2.38 mtx_trylock F GLIBC_2.38 mtx_unlock F GLIBC_2.38 pthread_clockjoin_np F GLIBC_2.38 pthread_create F -GLIBC_2.38 pthread_detach F GLIBC_2.38 pthread_exit F GLIBC_2.38 pthread_hurd_cond_timedwait_np F GLIBC_2.38 pthread_hurd_cond_wait_np F