From patchwork Tue Nov 19 00:56:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 101485 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 7AF233858CD9 for ; Tue, 19 Nov 2024 01:01:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7AF233858CD9 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 1508A385840E for ; Tue, 19 Nov 2024 00:56:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1508A385840E 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 1508A385840E 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=1731977814; cv=none; b=nBQo1xWThTHjMWN6S6uLj6WOu4+5iuxWubZCul57gzTdWTawbmhUrQTxnjZ/qcc/UxEEKXx3pDFo6UJrfHY4bzU57exmFPLYUf5lz7ZwHaA1TN3tbyDf4N+F4B2RGYwo+uFK7ngI6RkRCTHyC/vZO9x+u/bKIKCkpkq2aRbZWRc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731977814; c=relaxed/simple; bh=47CqQpk5Cy0zQwqSF9fI3G66all1IwQ8oOdSraR38As=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=U6oNHrwy5g5yVA/c9GSSWYSAraOKyiQ9+ixFxFSMSF2JDmRB9m7kVJUrOfunbbf/Y+jnIpnzRmv2c2T3z3RVTfrsvazemjvBVXdm++ZmVh0D1OR4GwveYW9+ZdxtcJ4ADejwIernKxjsegXbbJ2WwIwzDD9QrniMXVhLQ1yp2Ho= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 84E8AA1C8F; Tue, 19 Nov 2024 01:56:37 +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 NhepNsMb3pTf; Tue, 19 Nov 2024 01:56:37 +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 C550DA1C90; Tue, 19 Nov 2024 01:56:36 +0100 (CET) Received: from samy by begin with local (Exim 4.98) (envelope-from ) id 1tDCXk-0000000CrPB-19MP; Tue, 19 Nov 2024 01:56:36 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd,commited 13/13] htl: move pthread_attr_init into libc. Date: Tue, 19 Nov 2024 01:56:34 +0100 Message-ID: <20241119005634.3065147-14-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241119005634.3065147-1-samuel.thibault@ens-lyon.org> References: <20241119005634.3065147-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, 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 Signed-off-by: gfleury --- htl/Makefile | 2 +- htl/Versions | 4 ++-- htl/forward.c | 2 -- htl/pt-initialize.c | 1 - sysdeps/htl/pt-attr-init.c | 8 +++++++- sysdeps/htl/pthread-functions.h | 2 -- sysdeps/htl/pthreadP.h | 2 ++ sysdeps/mach/hurd/i386/libc.abilist | 1 + sysdeps/mach/hurd/i386/libpthread.abilist | 1 - sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 - 10 files changed, 13 insertions(+), 11 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 5c625d0ca9..25eb791031 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -25,7 +25,6 @@ SYSDEPS := lockfile LCLHDRS := libpthread-routines := \ - pt-attr-init \ pt-barrier-destroy \ pt-barrier-init \ pt-barrier-wait \ @@ -197,6 +196,7 @@ routines := \ pt-attr-getstack \ pt-attr-getstackaddr \ pt-attr-getstacksize \ + pt-attr-init \ pt-attr-setdetachstate \ pt-attr-setguardsize \ pt-attr-setinheritsched \ diff --git a/htl/Versions b/htl/Versions index 3374574869..afc2495e2f 100644 --- a/htl/Versions +++ b/htl/Versions @@ -25,6 +25,7 @@ libc { pthread_attr_setstack; pthread_attr_setscope; pthread_attr_setschedparam; + pthread_attr_init; } GLIBC_2.21 { @@ -74,6 +75,7 @@ libc { ___pthread_self; __pthread_init_thread; __pthread_default_attr; + __pthread_attr_init; __pthread_attr_getstacksize; __pthread_attr_getstackaddr; __pthread_attr_getstack; @@ -108,8 +110,6 @@ libpthread { pthread_atfork; - pthread_attr_init; - pthread_barrier_destroy; pthread_barrier_init; pthread_barrier_wait; pthread_barrierattr_destroy; pthread_barrierattr_getpshared; pthread_barrierattr_init; pthread_barrierattr_setpshared; diff --git a/htl/forward.c b/htl/forward.c index 179ec60bc5..7c0e16dc6e 100644 --- a/htl/forward.c +++ b/htl/forward.c @@ -53,8 +53,6 @@ name decl \ #define FORWARD(name, decl, params, defretval) \ FORWARD2 (name, int, decl, params, return defretval) -FORWARD (pthread_attr_init, (pthread_attr_t *attr), (attr), 0) - FORWARD (pthread_condattr_destroy, (pthread_condattr_t *attr), (attr), 0) FORWARD (pthread_condattr_init, (pthread_condattr_t *attr), (attr), 0) diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c index 835d741215..b082a13b54 100644 --- a/htl/pt-initialize.c +++ b/htl/pt-initialize.c @@ -27,7 +27,6 @@ #if IS_IN (libpthread) static const struct pthread_functions pthread_functions = { - .ptr_pthread_attr_init = __pthread_attr_init, .ptr_pthread_condattr_destroy = __pthread_condattr_destroy, .ptr_pthread_condattr_init = __pthread_condattr_init, .ptr_pthread_cond_broadcast = __pthread_cond_broadcast, diff --git a/sysdeps/htl/pt-attr-init.c b/sysdeps/htl/pt-attr-init.c index b01eb9ea62..959df0cb2a 100644 --- a/sysdeps/htl/pt-attr-init.c +++ b/sysdeps/htl/pt-attr-init.c @@ -17,6 +17,7 @@ . */ #include +#include #include int @@ -27,4 +28,9 @@ __pthread_attr_init (pthread_attr_t *attr) *attr = __pthread_default_attr; return 0; } -weak_alias (__pthread_attr_init, pthread_attr_init); +libc_hidden_def (__pthread_attr_init) +versioned_symbol (libc, __pthread_attr_init, pthread_attr_init, GLIBC_2_21); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_attr_init, pthread_attr_init, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index 17c97ef200..d380d17bc6 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -21,7 +21,6 @@ #include -int __pthread_attr_init (pthread_attr_t *); int __pthread_condattr_destroy (pthread_condattr_t *); int __pthread_condattr_init (pthread_condattr_t *); int __pthread_cond_broadcast (pthread_cond_t *); @@ -59,7 +58,6 @@ int _cthreads_ftrylockfile (FILE *); so if possible avoid breaking it and append new hooks to the end. */ struct pthread_functions { - int (*ptr_pthread_attr_init) (pthread_attr_t *); int (*ptr_pthread_condattr_destroy) (pthread_condattr_t *); int (*ptr_pthread_condattr_init) (pthread_condattr_t *); int (*ptr_pthread_cond_broadcast) (pthread_cond_t *); diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index 6f6f6dffc7..68e6cf17b0 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -97,10 +97,12 @@ libc_hidden_proto (__pthread_attr_setstack) int __pthread_attr_getstack (const pthread_attr_t *, void **, size_t *); libc_hidden_proto (__pthread_attr_getstack) void __pthread_testcancel (void); +int __pthread_attr_init (pthread_attr_t *attr); #define __pthread_raise_internal(__sig) raise (__sig) libc_hidden_proto (__pthread_self) +libc_hidden_proto (__pthread_attr_init) #if IS_IN (libpthread) hidden_proto (__pthread_create) diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 0672f31a69..101d5b8025 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -39,6 +39,7 @@ GLIBC_2.12 pthread_attr_getscope F GLIBC_2.12 pthread_attr_getstack F GLIBC_2.12 pthread_attr_getstackaddr F GLIBC_2.12 pthread_attr_getstacksize F +GLIBC_2.12 pthread_attr_init F GLIBC_2.12 pthread_attr_setdetachstate F GLIBC_2.12 pthread_attr_setguardsize F GLIBC_2.12 pthread_attr_setinheritsched F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 86d79bbc35..4e287c2e31 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -22,7 +22,6 @@ GLIBC_2.12 flockfile F GLIBC_2.12 ftrylockfile F GLIBC_2.12 funlockfile F GLIBC_2.12 pthread_atfork F -GLIBC_2.12 pthread_attr_init F GLIBC_2.12 pthread_barrier_destroy F GLIBC_2.12 pthread_barrier_init F GLIBC_2.12 pthread_barrier_wait F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 9e156b16bf..3396ea9e70 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -39,7 +39,6 @@ GLIBC_2.38 mtx_lock F GLIBC_2.38 mtx_timedlock F GLIBC_2.38 mtx_trylock F GLIBC_2.38 mtx_unlock F -GLIBC_2.38 pthread_attr_init F GLIBC_2.38 pthread_barrier_destroy F GLIBC_2.38 pthread_barrier_init F GLIBC_2.38 pthread_barrier_wait F