From patchwork Tue Nov 26 20:53:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 101928 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 9AACA3858435 for ; Tue, 26 Nov 2024 21:00:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9AACA3858435 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=Dyje0Hx4 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 61C5D3858432 for ; Tue, 26 Nov 2024 20:57:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 61C5D3858432 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 61C5D3858432 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1732654651; cv=none; b=CS/TdDj5C/RKEEnRrzlY2J5RQDvaM1WtIZDn2Vc+5Hg2q0YWzsuRgpEJiSFV/lRS2Vf2GdEJdwsOEZOiaoZWpYoqwu1oRNzKedBWEk9qZNHGgFCUn/YGtv20DOlsKk4nUdiWVoeLeQ4p8Xq91XiwbtHrmKIHXMX3ZR9z+Ycirik= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1732654651; c=relaxed/simple; bh=STaORpTtkUEbeOikSh7D5dUcE1Hx7msnYB915DYPKvs=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=J9ETcX8Lvp7mho8aWfxnoxH8kufnjTVtvoGdhU/b6rAxQ59kK4ZsXu90TswBLZXJI5JQEhbRMUcRiud/r2Qo1BwHrFkJMJMw5qj8i+s877xTAd4aB2uaed3qPBwHpLrWprinFCal6cigb0E+8Bsqo9zk0e+Riifc5iulnpuZ034= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 61C5D3858432 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 7516D24F39; Tue, 26 Nov 2024 21:57:28 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id CbCWJvrW3Gly; Tue, 26 Nov 2024 21:57:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1732654644; bh=STaORpTtkUEbeOikSh7D5dUcE1Hx7msnYB915DYPKvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Dyje0Hx4XjWO+herlHjaoUJMuQjuJX9akOKlRJZIIXgiTO6upPBpjXGP/z2d3QKqa cHF6UxXDZ1/053tqLrhq6ogydTIIuNRe3LshHvrJzRKjJ59YUUeAcNBwED/Bg3eine QYzkJdRytmWk5Usbl0oHi9i6WXSVmeO4YjqOFg+Ctq2geQixxkVrws1XhVUL9v9tWc d+WMn37G7/QhE0mkC+9AE8gxLM3twks1ScHo2IV8Nf74JcDWbWH24q5CScPVjnZ27R G8tOk09E9Z4JX9uPMw2PYakiGWu0lToKV5MfEueN/qYPNygRAoj0d9M60WJyP08l/D KKJM8GoK2laqg== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 5/7] htl: move pthread_condattr_init into libc. Date: Tue, 26 Nov 2024 22:53:27 +0200 Message-Id: <20241126205329.2215295-6-gfleury@disroot.org> In-Reply-To: <20241126205329.2215295-1-gfleury@disroot.org> References: <20241126205329.2215295-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, 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 Signed-off-by: gfleury --- htl/Makefile | 2 +- htl/Versions | 3 ++- htl/forward.c | 3 --- htl/pt-initialize.c | 1 - sysdeps/htl/pt-condattr-init.c | 7 ++++++- 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, 12 insertions(+), 11 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 60a28e0c..e68cf2b5 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -92,7 +92,6 @@ libpthread-routines := \ pt-rwlock-timedrdlock \ pt-rwlock-timedwrlock \ pt-rwlock-unlock \ - pt-condattr-init \ pt-condattr-setclock \ pt-condattr-setpshared \ pt-cond-destroy \ @@ -206,6 +205,7 @@ routines := \ pt-condattr-destroy \ pt-condattr-getclock \ pt-condattr-getpshared \ + pt-condattr-init \ pt-getschedparam \ pt-nthreads \ pt-pthread_self \ diff --git a/htl/Versions b/htl/Versions index 33106014..95c8a521 100644 --- a/htl/Versions +++ b/htl/Versions @@ -27,6 +27,7 @@ libc { pthread_attr_setschedparam; pthread_attr_init; pthread_condattr_getclock; + pthread_condattr_init; pthread_condattr_destroy; pthread_condattr_getpshared; } @@ -87,6 +88,7 @@ libc { __pthread_attr_setstacksize; __pthread_attr_setstackaddr; __pthread_attr_setstack; + __pthread_condattr_init; __pthread_default_condattr; } } @@ -125,7 +127,6 @@ libpthread { pthread_cond_broadcast; pthread_cond_destroy; pthread_cond_init; pthread_cond_signal; pthread_cond_timedwait; pthread_cond_wait; - pthread_condattr_init; pthread_condattr_setclock; pthread_condattr_setpshared; pthread_create; pthread_detach; pthread_exit; diff --git a/htl/forward.c b/htl/forward.c index 3fe0a74d..48825de0 100644 --- a/htl/forward.c +++ b/htl/forward.c @@ -53,9 +53,6 @@ name decl \ #define FORWARD(name, decl, params, defretval) \ FORWARD2 (name, int, decl, params, return defretval) -FORWARD (pthread_condattr_init, (pthread_condattr_t *attr), (attr), 0) - - FORWARD (pthread_cond_broadcast, (pthread_cond_t *cond), (cond), 0) FORWARD (pthread_cond_destroy, (pthread_cond_t *cond), (cond), 0) FORWARD (pthread_cond_init, diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c index 632ee847..ae721f3a 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_condattr_init = __pthread_condattr_init, .ptr_pthread_cond_broadcast = __pthread_cond_broadcast, .ptr_pthread_cond_destroy = __pthread_cond_destroy, .ptr_pthread_cond_init = __pthread_cond_init, diff --git a/sysdeps/htl/pt-condattr-init.c b/sysdeps/htl/pt-condattr-init.c index 4f7486a2..7ffa1622 100644 --- a/sysdeps/htl/pt-condattr-init.c +++ b/sysdeps/htl/pt-condattr-init.c @@ -17,6 +17,7 @@ . */ #include +#include #include int @@ -27,5 +28,9 @@ __pthread_condattr_init (pthread_condattr_t *attr) *attr = __pthread_default_condattr; return 0; } +libc_hidden_def (__pthread_condattr_init) +versioned_symbol (libc, __pthread_condattr_init, pthread_condattr_init, GLIBC_2_21); -weak_alias (__pthread_condattr_init, pthread_condattr_init); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_condattr_init, pthread_condattr_init, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index 6bd01682..8ee01d3f 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -21,7 +21,6 @@ #include -int __pthread_condattr_init (pthread_condattr_t *); int __pthread_cond_broadcast (pthread_cond_t *); int __pthread_cond_destroy (pthread_cond_t *); int __pthread_cond_init (pthread_cond_t *, @@ -57,7 +56,6 @@ int _cthreads_ftrylockfile (FILE *); so if possible avoid breaking it and append new hooks to the end. */ struct pthread_functions { - int (*ptr_pthread_condattr_init) (pthread_condattr_t *); int (*ptr_pthread_cond_broadcast) (pthread_cond_t *); int (*ptr_pthread_cond_destroy) (pthread_cond_t *); int (*ptr_pthread_cond_init) (pthread_cond_t *, diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index 68e6cf17..afdf2cbd 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -98,11 +98,13 @@ 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); +int __pthread_condattr_init (pthread_condattr_t *attr); #define __pthread_raise_internal(__sig) raise (__sig) libc_hidden_proto (__pthread_self) libc_hidden_proto (__pthread_attr_init) +libc_hidden_proto (__pthread_condattr_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 de6db602..1e3e6489 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -52,6 +52,7 @@ GLIBC_2.12 pthread_attr_setstacksize F GLIBC_2.12 pthread_condattr_destroy F GLIBC_2.12 pthread_condattr_getclock F GLIBC_2.12 pthread_condattr_getpshared F +GLIBC_2.12 pthread_condattr_init F GLIBC_2.12 pthread_equal F GLIBC_2.12 pthread_getschedparam F GLIBC_2.12 pthread_self F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 6a1e221e..6bacf9a4 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -36,7 +36,6 @@ GLIBC_2.12 pthread_cond_init F GLIBC_2.12 pthread_cond_signal F GLIBC_2.12 pthread_cond_timedwait F GLIBC_2.12 pthread_cond_wait 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_create F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index ae4480ca..35ff3d03 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_cond_init F GLIBC_2.38 pthread_cond_signal F GLIBC_2.38 pthread_cond_timedwait F GLIBC_2.38 pthread_cond_wait 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_create F