From patchwork Tue Nov 19 00:56:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 101475 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 75E11385842C for ; Tue, 19 Nov 2024 00:57:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75E11385842C X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 1BBAD3858D21 for ; Tue, 19 Nov 2024 00:56:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1BBAD3858D21 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 1BBAD3858D21 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=1731977804; cv=none; b=O0pARbAnZaUWDVMqU0SUKBbuolMYu+GK6iMr0Eht9Zf6Q+ZFxkbwuXx/oZvYIgTQPgaCCVJOsSxLJ4rusHAQvWOXvyJpGK5150BW4a+feUXl/efG4tsE3mlzxrbF4wk7efrasbCAaCuYJKz9BUVssYjPOH6lqQSpnQXsSrh8B38= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731977804; c=relaxed/simple; bh=9Xd4eXpHcsXsJXdRaM7AHZuBo+7gAEO69Qut93Iah+4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=r7qCrD99llhgzypYh7SJ8+64Vdg33Gg3V4CZiuuagRPnu+fKv6rIyVeWftVyNSXV85GBEKqjj0BxaLX97v1QuytPNk5v2zRsc+k+ae93oEivGlZpny+hOpdIRJpkUhH8WZxsSkcaJqHXPDvwulFABUjL6UCuyyPenjzcCsqON4M= 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 4756AA1C24; 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 wJ_PYUn7PDcp; 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 BAA36A1B24; Tue, 19 Nov 2024 01:56:36 +0100 (CET) Received: from samy by begin with local (Exim 4.98) (envelope-from ) id 1tDCXk-0000000CrOw-0mDB; 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 09/13] htl: move pthread_attr_setstackaddr into libc. Date: Tue, 19 Nov 2024 01:56:30 +0100 Message-ID: <20241119005634.3065147-10-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.1 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 | 4 ++-- htl/Versions | 8 +++++++- sysdeps/htl/pt-attr-setstack.c | 9 +++++++-- sysdeps/htl/pt-attr-setstackaddr.c | 8 +++++++- sysdeps/htl/pthreadP.h | 2 ++ sysdeps/mach/hurd/i386/libc.abilist | 4 ++++ sysdeps/mach/hurd/i386/libpthread.abilist | 2 -- sysdeps/mach/hurd/x86_64/libc.abilist | 4 ++++ sysdeps/mach/hurd/x86_64/libpthread.abilist | 2 -- 9 files changed, 33 insertions(+), 10 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 445c0af8ae..d76cba8830 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -29,8 +29,6 @@ libpthread-routines := \ pt-attr-setguardsize \ pt-attr-setschedparam \ pt-attr-setscope \ - pt-attr-setstack \ - pt-attr-setstackaddr \ pt-barrier-destroy \ pt-barrier-init \ pt-barrier-wait \ @@ -205,6 +203,8 @@ routines := \ pt-attr-setdetachstate \ pt-attr-setinheritsched \ pt-attr-setschedpolicy \ + pt-attr-setstack \ + pt-attr-setstackaddr \ pt-attr-setstacksize \ pt-getschedparam \ pt-nthreads \ diff --git a/htl/Versions b/htl/Versions index 096b1c32ff..db8a2de27c 100644 --- a/htl/Versions +++ b/htl/Versions @@ -20,6 +20,8 @@ libc { pthread_attr_getstackaddr; pthread_attr_getstack; pthread_attr_setstacksize; + pthread_attr_setstackaddr; + pthread_attr_setstack; } GLIBC_2.21 { @@ -55,6 +57,8 @@ libc { pthread_attr_getstackaddr; pthread_attr_getstack; pthread_attr_setstacksize; + pthread_attr_setstackaddr; + pthread_attr_setstack; } @@ -70,6 +74,8 @@ libc { __pthread_attr_getstackaddr; __pthread_attr_getstack; __pthread_attr_setstacksize; + __pthread_attr_setstackaddr; + __pthread_attr_setstack; } } @@ -101,7 +107,7 @@ libpthread { pthread_attr_init; pthread_attr_setguardsize; pthread_attr_setschedparam; - pthread_attr_setscope; pthread_attr_setstack; pthread_attr_setstackaddr; + pthread_attr_setscope; pthread_barrier_destroy; pthread_barrier_init; pthread_barrier_wait; pthread_barrierattr_destroy; pthread_barrierattr_getpshared; diff --git a/sysdeps/htl/pt-attr-setstack.c b/sysdeps/htl/pt-attr-setstack.c index 9ac6fe1404..c02a13b695 100644 --- a/sysdeps/htl/pt-attr-setstack.c +++ b/sysdeps/htl/pt-attr-setstack.c @@ -18,7 +18,7 @@ #include #include - +#include #include #include @@ -47,4 +47,9 @@ __pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, size_t stacksize return 0; } -weak_alias (__pthread_attr_setstack, pthread_attr_setstack) +libc_hidden_def (__pthread_attr_setstack) +versioned_symbol (libc, __pthread_attr_setstack, pthread_attr_setstack, GLIBC_2_41); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_41) +compat_symbol (libpthread, __pthread_attr_setstack, pthread_attr_setstack, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pt-attr-setstackaddr.c b/sysdeps/htl/pt-attr-setstackaddr.c index c4fda746b6..6941ef8544 100644 --- a/sysdeps/htl/pt-attr-setstackaddr.c +++ b/sysdeps/htl/pt-attr-setstackaddr.c @@ -17,6 +17,7 @@ . */ #include +#include #include int @@ -25,4 +26,9 @@ __pthread_attr_setstackaddr (pthread_attr_t *attr, void *stackaddr) attr->__stackaddr = stackaddr; return 0; } -weak_alias (__pthread_attr_setstackaddr, pthread_attr_setstackaddr) +libc_hidden_def (__pthread_attr_setstackaddr) +versioned_symbol (libc, __pthread_attr_setstackaddr, pthread_attr_setstackaddr, GLIBC_2_41); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_41) +compat_symbol (libpthread, __pthread_attr_setstackaddr,pthread_attr_setstackaddr, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index f54c9490df..6f6f6dffc7 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -85,6 +85,7 @@ int __pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr); libc_hidden_proto (__pthread_attr_getstackaddr) int __pthread_attr_setstackaddr (pthread_attr_t *__attr, void *__stackaddr); +libc_hidden_proto (__pthread_attr_setstackaddr) int __pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr, size_t *__restrict __stacksize); libc_hidden_proto (__pthread_attr_getstacksize) @@ -92,6 +93,7 @@ int __pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize); libc_hidden_proto (__pthread_attr_setstacksize) int __pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, size_t __stacksize); +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); diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index d7946ed96a..dabb1359ba 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -42,6 +42,8 @@ GLIBC_2.12 pthread_attr_getstacksize F GLIBC_2.12 pthread_attr_setdetachstate F GLIBC_2.12 pthread_attr_setinheritsched F GLIBC_2.12 pthread_attr_setschedpolicy F +GLIBC_2.12 pthread_attr_setstack F +GLIBC_2.12 pthread_attr_setstackaddr F GLIBC_2.12 pthread_attr_setstacksize F GLIBC_2.12 pthread_equal F GLIBC_2.12 pthread_getschedparam F @@ -2493,6 +2495,8 @@ GLIBC_2.41 pthread_attr_getguardsize F GLIBC_2.41 pthread_attr_getstack F GLIBC_2.41 pthread_attr_getstackaddr F GLIBC_2.41 pthread_attr_getstacksize F +GLIBC_2.41 pthread_attr_setstack F +GLIBC_2.41 pthread_attr_setstackaddr F GLIBC_2.41 pthread_attr_setstacksize F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 1c0610c527..61c6d869b5 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -26,8 +26,6 @@ GLIBC_2.12 pthread_attr_init F GLIBC_2.12 pthread_attr_setguardsize F GLIBC_2.12 pthread_attr_setschedparam F GLIBC_2.12 pthread_attr_setscope F -GLIBC_2.12 pthread_attr_setstack F -GLIBC_2.12 pthread_attr_setstackaddr 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/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index 46b8694afc..f4f65ca353 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1527,6 +1527,8 @@ GLIBC_2.38 pthread_attr_setinheritsched F GLIBC_2.38 pthread_attr_setschedparam F GLIBC_2.38 pthread_attr_setschedpolicy F GLIBC_2.38 pthread_attr_setscope F +GLIBC_2.38 pthread_attr_setstack F +GLIBC_2.38 pthread_attr_setstackaddr F GLIBC_2.38 pthread_attr_setstacksize F GLIBC_2.38 pthread_cond_broadcast F GLIBC_2.38 pthread_cond_destroy F @@ -2193,6 +2195,8 @@ GLIBC_2.41 pthread_attr_getguardsize F GLIBC_2.41 pthread_attr_getstack F GLIBC_2.41 pthread_attr_getstackaddr F GLIBC_2.41 pthread_attr_getstacksize F +GLIBC_2.41 pthread_attr_setstack F +GLIBC_2.41 pthread_attr_setstackaddr F GLIBC_2.41 pthread_attr_setstacksize F HURD_CTHREADS_0.3 __cthread_getspecific F HURD_CTHREADS_0.3 __cthread_keycreate F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 9626176f6d..2f57b85269 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -43,8 +43,6 @@ GLIBC_2.38 pthread_attr_init F GLIBC_2.38 pthread_attr_setguardsize F GLIBC_2.38 pthread_attr_setschedparam F GLIBC_2.38 pthread_attr_setscope F -GLIBC_2.38 pthread_attr_setstack F -GLIBC_2.38 pthread_attr_setstackaddr F GLIBC_2.38 pthread_barrier_destroy F GLIBC_2.38 pthread_barrier_init F GLIBC_2.38 pthread_barrier_wait F