From patchwork Wed Jan 29 01:33:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 105581 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 304663857B9F for ; Wed, 29 Jan 2025 01:35:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 304663857B9F 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 A0DE73857C7F for ; Wed, 29 Jan 2025 01:33:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A0DE73857C7F 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 A0DE73857C7F 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=1738114436; cv=none; b=rk0LJNxkHCBfe2G8jyDyoSPq0Nm/fgRbRFq/+Am7p0ZVIUnAUPgtCKUIv9vnNajMUGUTapUyrzQJzp1OjWejjVyUkmirBFpA9ERfZ2XPGvKrDGAcN52vrDhFN8udMUjPyW4+VeD7yhJv+uauvBBN1ODohVhIHXtqV4LzmtNbS+0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738114436; c=relaxed/simple; bh=+K0JB+pq95ZquPOOD/k6ZGnNl/+VKN98hd/FZ9tMPzY=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Bdsiut5Pvs/Vz6WPKImw12O0xZrb7iBfaDNWz3zWFMW225SxjigCzKFC8Z7dCpWQHQCYkQv+D8T8AiKtFk0yXwUsLQwTclKvzWx17uX/QJ3ZmYZAg7Fc7Vy7daCIv3J94SILHIL9lCOkwCoO9o7VVePGkuYqm+0GvwsklXwkivE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A0DE73857C7F Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id A6F1EA19A2; Wed, 29 Jan 2025 02:33:44 +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 w5ptFXXw73Ta; Wed, 29 Jan 2025 02:33:44 +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 3FA99A19BA; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from samy by begin with local (Exim 4.98) (envelope-from ) id 1tcwxb-0000000AtU3-3BMP; Wed, 29 Jan 2025 02:33:43 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd,commited 5/7] htl: move pthread_mutex_destroy into libc. Date: Wed, 29 Jan 2025 02:33:40 +0100 Message-ID: <20250129013342.2596522-6-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> References: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> 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, T_SCC_BODY_TEXT_LINE 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: <20250103103750.870897-5-gfleury@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 4 ++-- htl/forward.c | 2 -- htl/pt-initialize.c | 1 - sysdeps/htl/libc-lockP.h | 2 -- sysdeps/htl/pthread-functions.h | 2 -- sysdeps/htl/pthreadP.h | 2 -- sysdeps/mach/hurd/htl/pt-mutex-destroy.c | 8 ++++++-- sysdeps/mach/hurd/i386/libc.abilist | 1 + sysdeps/mach/hurd/i386/libpthread.abilist | 1 - sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 - 11 files changed, 10 insertions(+), 16 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index f7e12983d2..f6abd95772 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -54,7 +54,6 @@ libpthread-routines := \ pt-setcanceltype \ pt-testcancel \ pt-cancel \ - pt-mutex-destroy \ pt-mutex-transfer-np \ pt-mutex-consistent \ pt-rwlock-attr \ @@ -182,6 +181,7 @@ routines := \ pt-condattr-setpshared \ pt-getschedparam \ pt-mutex-checklocked \ + pt-mutex-destroy \ pt-mutex-getprioceiling \ pt-mutex-init \ pt-mutex-lock \ diff --git a/htl/Versions b/htl/Versions index 9c016bc6cf..9cd9f5a937 100644 --- a/htl/Versions +++ b/htl/Versions @@ -38,6 +38,7 @@ libc { pthread_condattr_getpshared; pthread_condattr_setclock; pthread_condattr_setpshared; + pthread_mutex_destroy; pthread_mutex_getprioceiling; pthread_mutex_init; pthread_mutex_lock; @@ -151,6 +152,7 @@ libc { __pthread_condattr_init; __pthread_default_condattr; __pthread_mutex_checklocked; + __pthread_mutex_destroy; __pthread_mutex_init; __pthread_mutex_lock; __pthread_mutex_timedlock; @@ -214,7 +216,6 @@ libpthread { pthread_kill; __pthread_kill; - pthread_mutex_destroy; pthread_mutex_transfer_np; pthread_once; @@ -283,7 +284,6 @@ libpthread { __pthread_getspecific; __pthread_setspecific; __pthread_getattr_np; - __pthread_mutex_destroy; __pthread_enable_asynccancel; __pthread_disable_asynccancel; _pthread_rwlock_destroy; _pthread_rwlock_init; diff --git a/htl/forward.c b/htl/forward.c index b71099b82b..636902919e 100644 --- a/htl/forward.c +++ b/htl/forward.c @@ -58,8 +58,6 @@ FORWARD_NORETURN (__pthread_exit, void, (void *retval), (retval), exit (EXIT_SUCCESS)) strong_alias (__pthread_exit, pthread_exit); -FORWARD (pthread_mutex_destroy, (pthread_mutex_t *mutex), (mutex), 0) - FORWARD (__pthread_setcancelstate, (int state, int *oldstate), (state, oldstate), 0) strong_alias (__pthread_setcancelstate, pthread_setcancelstate); diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c index b8f8c95ce3..5854bc4967 100644 --- a/htl/pt-initialize.c +++ b/htl/pt-initialize.c @@ -28,7 +28,6 @@ #if IS_IN (libpthread) static const struct pthread_functions pthread_functions = { .ptr___pthread_exit = __pthread_exit, - .ptr_pthread_mutex_destroy = __pthread_mutex_destroy, .ptr___pthread_setcancelstate = __pthread_setcancelstate, .ptr_pthread_setcanceltype = __pthread_setcanceltype, .ptr___pthread_get_cleanup_stack = __pthread_get_cleanup_stack, diff --git a/sysdeps/htl/libc-lockP.h b/sysdeps/htl/libc-lockP.h index 3d74cd87e9..f39c8bba87 100644 --- a/sysdeps/htl/libc-lockP.h +++ b/sysdeps/htl/libc-lockP.h @@ -117,7 +117,6 @@ extern int __pthread_atfork (void (*__prepare) (void), single-threaded processes. */ #if !defined(__NO_WEAK_PTHREAD_ALIASES) && !IS_IN (libpthread) # ifdef weak_extern -weak_extern (__pthread_mutex_destroy) weak_extern (__pthread_rwlock_init) weak_extern (__pthread_rwlock_destroy) weak_extern (__pthread_rwlock_rdlock) @@ -133,7 +132,6 @@ weak_extern (__pthread_initialize) weak_extern (__pthread_atfork) weak_extern (__pthread_setcancelstate) # else -# pragma weak __pthread_mutex_destroy # pragma weak __pthread_rwlock_destroy # pragma weak __pthread_rwlock_rdlock # pragma weak __pthread_rwlock_tryrdlock diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index c44c9038f3..45f15c2641 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -22,7 +22,6 @@ #include void __pthread_exit (void *) __attribute__ ((__noreturn__)); -int _pthread_mutex_destroy (pthread_mutex_t *); int __pthread_setcancelstate (int, int *); int __pthread_setcanceltype (int, int *); struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void); @@ -44,7 +43,6 @@ int _cthreads_ftrylockfile (FILE *); struct pthread_functions { void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__)); - int (*ptr_pthread_mutex_destroy) (pthread_mutex_t *); int (*ptr___pthread_setcancelstate) (int, int *); int (*ptr_pthread_setcanceltype) (int, int *); struct __pthread_cancelation_handler **(*ptr___pthread_get_cleanup_stack) (void); diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index e41cb4c85d..f8aab6af9e 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -36,7 +36,6 @@ libc_hidden_proto (__pthread_mutex_init) extern int __pthread_mutex_clocklock (pthread_mutex_t *__mutex, clockid_t __clockid, const struct timespec *__abstime); libc_hidden_proto (__pthread_mutex_clocklock) -extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex); extern int __pthread_mutex_lock (pthread_mutex_t *__mutex); libc_hidden_proto (__pthread_mutex_lock) extern int __pthread_mutex_getprioceiling (const pthread_mutex_t *__mutex, @@ -176,7 +175,6 @@ hidden_proto (__pthread_detach) hidden_proto (__pthread_key_create) hidden_proto (__pthread_getspecific) hidden_proto (__pthread_setspecific) -hidden_proto (__pthread_mutex_destroy) hidden_proto (__pthread_get_cleanup_stack) #endif diff --git a/sysdeps/mach/hurd/htl/pt-mutex-destroy.c b/sysdeps/mach/hurd/htl/pt-mutex-destroy.c index fdb59623bb..c0624ec72f 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-destroy.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-destroy.c @@ -22,6 +22,7 @@ #include #include "pt-mutex.h" #include +#include int __pthread_mutex_destroy (pthread_mutex_t *mtxp) @@ -33,6 +34,9 @@ __pthread_mutex_destroy (pthread_mutex_t *mtxp) mtxp->__type = -1; return 0; } +libc_hidden_def (__pthread_mutex_destroy) +versioned_symbol (libc, __pthread_mutex_destroy, pthread_mutex_destroy, GLIBC_2_21); -weak_alias (__pthread_mutex_destroy, pthread_mutex_destroy) -hidden_def (__pthread_mutex_destroy) +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_mutex_destroy, pthread_mutex_destroy, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index c980b46bca..f153f475c3 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -63,6 +63,7 @@ GLIBC_2.12 pthread_condattr_setclock F GLIBC_2.12 pthread_condattr_setpshared F GLIBC_2.12 pthread_equal F GLIBC_2.12 pthread_getschedparam F +GLIBC_2.12 pthread_mutex_destroy F GLIBC_2.12 pthread_mutex_getprioceiling F GLIBC_2.12 pthread_mutex_init F GLIBC_2.12 pthread_mutex_lock F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 0eb452eb02..53b433c725 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -41,7 +41,6 @@ GLIBC_2.12 pthread_join F 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_destroy F GLIBC_2.12 pthread_mutex_transfer_np F GLIBC_2.12 pthread_once F GLIBC_2.12 pthread_rwlock_destroy F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index faeac21d94..5f0f73d10f 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -63,7 +63,6 @@ GLIBC_2.38 pthread_key_delete F GLIBC_2.38 pthread_kill F GLIBC_2.38 pthread_mutex_consistent F GLIBC_2.38 pthread_mutex_consistent_np F -GLIBC_2.38 pthread_mutex_destroy F GLIBC_2.38 pthread_mutex_transfer_np F GLIBC_2.38 pthread_once F GLIBC_2.38 pthread_rwlock_clockrdlock F