From patchwork Sun Mar 2 17:27:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 107297 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 AB6DA3858D28 for ; Sun, 2 Mar 2025 17:28:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB6DA3858D28 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 5D6C63858D3C for ; Sun, 2 Mar 2025 17:27:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5D6C63858D3C 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 5D6C63858D3C 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=1740936450; cv=none; b=MDAaq0ntf5DJ1DbfHJT7vuq4+r6fETMalU86n3F+2b5pP6xRfZlkU65Iu7oNP2VhlCzfsI1c7kFDZPr7kgqBWp5nPDDcAS9rSfcBNlBUxggAZhLW0Shy1YbvJ4OFD/fIPtymGopcDBFmdLVxe+DjAh3NwdZXvcZQPaxCPnr0agM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740936450; c=relaxed/simple; bh=+XLZZZ6B/AiIkjOSdbHDtjcQbjPByldfKAuVH76ZLE0=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=XgBEngZG5SOd5ivWlEtBFT72fX9r6U0/AWLijuELDGlsvv5dLVzwmztfq9d0dY036f+P9EC0TyDFZEnMEGcVHo+yWrRxyQJLElcR0eul2aKlfsQopx15GGO4POzQCP6HseLBGsWNAiRhm8hwhMYYcNKuo+gXAFafKgygq5dqx9I= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D6C63858D3C Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id D31C3A5E3C; Sun, 2 Mar 2025 18:27:28 +0100 (CET) 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 Rqo3q1HjhWbs; Sun, 2 Mar 2025 18:27:28 +0100 (CET) Received: from begin (aamiens-653-1-40-48.w83-192.abo.wanadoo.fr [83.192.199.48]) (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 5CDC7A01A8; Sun, 2 Mar 2025 18:27:28 +0100 (CET) Received: from samy by begin with local (Exim 4.98) (envelope-from ) id 1ton67-00000007EpB-44dh; Sun, 02 Mar 2025 18:27:27 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd,commited] htl: move pthread_once into libc Date: Sun, 2 Mar 2025 18:27:27 +0100 Message-ID: <20250302172727.1725273-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.47.2 MIME-Version: 1.0 X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, 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 --- htl/Makefile | 2 +- htl/Versions | 5 +++-- sysdeps/htl/libc-lockP.h | 3 +-- sysdeps/htl/pt-once.c | 8 +++++++- sysdeps/mach/hurd/i386/libc.abilist | 2 ++ sysdeps/mach/hurd/i386/libpthread.abilist | 1 - sysdeps/mach/hurd/x86_64/libc.abilist | 2 ++ sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 - 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 310097914f..603af24ce4 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -31,7 +31,6 @@ libpthread-routines := \ pt-key-delete \ pt-getspecific \ pt-setspecific \ - pt-once \ pt-alloc \ pt-create \ pt-getattr \ @@ -186,6 +185,7 @@ routines := \ pt-mutexattr-setrobust \ pt-mutexattr-settype \ pt-nthreads \ + pt-once \ pt-pthread_self \ pt-rwlock-attr \ pt-rwlock-destroy \ diff --git a/htl/Versions b/htl/Versions index 3d2cb4e7a4..a07a3b3708 100644 --- a/htl/Versions +++ b/htl/Versions @@ -63,6 +63,7 @@ libc { pthread_mutexattr_setprotocol; pthread_mutexattr_setpshared; pthread_mutexattr_settype; + pthread_once; pthread_rwlock_destroy; pthread_rwlock_init; pthread_rwlock_rdlock; @@ -158,6 +159,7 @@ libc { pthread_mutex_setprioceiling; pthread_rwlock_destroy; pthread_mutex_trylock; + pthread_once; pthread_rwlock_clockrdlock; pthread_rwlock_clockwrlock; pthread_rwlock_init; @@ -211,6 +213,7 @@ libc { __pthread_mutexattr_destroy; __pthread_mutexattr_init; __pthread_mutexattr_settype; + __pthread_once; __pthread_sigstate; __pthread_sigstate_destroy; __pthread_sigmask; @@ -264,8 +267,6 @@ libpthread { pthread_mutex_transfer_np; - pthread_once; - pthread_setconcurrency; pthread_setschedprio; pthread_setspecific; diff --git a/sysdeps/htl/libc-lockP.h b/sysdeps/htl/libc-lockP.h index 5085570baa..092eb35831 100644 --- a/sysdeps/htl/libc-lockP.h +++ b/sysdeps/htl/libc-lockP.h @@ -114,6 +114,7 @@ libc_hidden_proto (__pthread_rwlock_unlock) extern int __pthread_once (pthread_once_t *__once_control, void (*__init_routine) (void)); +libc_hidden_proto (__pthread_once); extern int __pthread_atfork (void (*__prepare) (void), void (*__parent) (void), @@ -128,14 +129,12 @@ libc_hidden_proto (__pthread_setcancelstate) weak_extern (__pthread_key_create) weak_extern (__pthread_setspecific) weak_extern (__pthread_getspecific) -weak_extern (__pthread_once) weak_extern (__pthread_initialize) weak_extern (__pthread_atfork) # else # pragma weak __pthread_key_create # pragma weak __pthread_setspecific # pragma weak __pthread_getspecific -# pragma weak __pthread_once # pragma weak __pthread_initialize # pragma weak __pthread_atfork # endif diff --git a/sysdeps/htl/pt-once.c b/sysdeps/htl/pt-once.c index 68fb2e1129..1f999ce492 100644 --- a/sysdeps/htl/pt-once.c +++ b/sysdeps/htl/pt-once.c @@ -20,6 +20,7 @@ #include #include +#include static void clear_once_control (void *arg) @@ -53,4 +54,9 @@ __pthread_once (pthread_once_t *once_control, void (*init_routine) (void)) return 0; } -weak_alias (__pthread_once, pthread_once); +libc_hidden_def (__pthread_once) +versioned_symbol (libc, __pthread_once, pthread_once, GLIBC_2_42); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_42) +compat_symbol (libpthread, __pthread_once, pthread_once, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index bf62539c57..461df01ffb 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -88,6 +88,7 @@ GLIBC_2.12 pthread_mutexattr_setprioceiling F GLIBC_2.12 pthread_mutexattr_setprotocol F GLIBC_2.12 pthread_mutexattr_setpshared F GLIBC_2.12 pthread_mutexattr_settype F +GLIBC_2.12 pthread_once F GLIBC_2.12 pthread_rwlock_destroy F GLIBC_2.12 pthread_rwlock_init F GLIBC_2.12 pthread_rwlock_rdlock F @@ -2595,6 +2596,7 @@ GLIBC_2.42 pthread_mutex_consistent_np F GLIBC_2.42 pthread_mutex_getprioceiling F GLIBC_2.42 pthread_mutex_setprioceiling F GLIBC_2.42 pthread_mutex_trylock F +GLIBC_2.42 pthread_once F GLIBC_2.42 pthread_rwlock_clockrdlock F GLIBC_2.42 pthread_rwlock_clockwrlock F GLIBC_2.42 pthread_rwlock_destroy F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index d9c1a1790a..b067d377b3 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -35,7 +35,6 @@ GLIBC_2.12 pthread_key_create F GLIBC_2.12 pthread_key_delete F GLIBC_2.12 pthread_kill F GLIBC_2.12 pthread_mutex_transfer_np F -GLIBC_2.12 pthread_once F GLIBC_2.12 pthread_setconcurrency F GLIBC_2.12 pthread_setschedprio F GLIBC_2.12 pthread_setspecific F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index fb068ab45e..6f235d20ba 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1579,6 +1579,7 @@ GLIBC_2.38 pthread_mutexattr_setpshared F GLIBC_2.38 pthread_mutexattr_setrobust F GLIBC_2.38 pthread_mutexattr_setrobust_np F GLIBC_2.38 pthread_mutexattr_settype F +GLIBC_2.38 pthread_once F GLIBC_2.38 pthread_rwlock_clockrdlock F GLIBC_2.38 pthread_rwlock_clockwrlock F GLIBC_2.38 pthread_rwlock_destroy F @@ -2278,6 +2279,7 @@ GLIBC_2.42 pthread_mutex_consistent_np F GLIBC_2.42 pthread_mutex_getprioceiling F GLIBC_2.42 pthread_mutex_setprioceiling F GLIBC_2.42 pthread_mutex_trylock F +GLIBC_2.42 pthread_once F GLIBC_2.42 pthread_rwlock_clockrdlock F GLIBC_2.42 pthread_rwlock_clockwrlock F GLIBC_2.42 pthread_rwlock_destroy F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 71ce1d6288..6b8acec832 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -55,7 +55,6 @@ GLIBC_2.38 pthread_key_create F GLIBC_2.38 pthread_key_delete F GLIBC_2.38 pthread_kill F GLIBC_2.38 pthread_mutex_transfer_np F -GLIBC_2.38 pthread_once F GLIBC_2.38 pthread_setconcurrency F GLIBC_2.38 pthread_setschedprio F GLIBC_2.38 pthread_setspecific F