From patchwork Wed Jul 17 00:26:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1961356 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WNxZc44v6z1ySl for ; Wed, 17 Jul 2024 10:26:48 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 455AA38449D0 for ; Wed, 17 Jul 2024 00:26:46 +0000 (GMT) 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 41956384A469 for ; Wed, 17 Jul 2024 00:26:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 41956384A469 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 41956384A469 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=1721175985; cv=none; b=C3xhh4VUn2gmCjy3mNt73yIepfPGBTcPukZhdWdZPQr/8LH9Dbcx+gpatY4piwoByLGkaTO+n+gSIFy2a2FcTpBywrPVJDmdj8VnSXpbm+8p5wmWx1YINoc5z4ZvfWNxor28ZZKEV89J4Dw12jaIKx/y8UfMD6NcxrLjWqsILZQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721175985; c=relaxed/simple; bh=TLkXlcsdqTnRxyTPO8cLTcKrtNkGx1GpIrX+wNWBKp4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=DjtKw5JJJrn/wbr+nSbVymSiDD3qTXF4NiJ7tMX/nuLt2iq/DfYHrldwMr5mMIDV1HwASy4In93kouaZYKlWEbxX0vRUN7OV/QTGtJ1uxbt/Hk9RUtw8rzYK2ym50rtFjBdsezRu2Td8A2Ejw5Ylv00mse+MmbZir+Ul0HecyIo= 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 6E891A033B; Wed, 17 Jul 2024 02:26:22 +0200 (CEST) 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 hcRmItgWINrJ; Wed, 17 Jul 2024 02:26:22 +0200 (CEST) Received: from begin (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr [83.192.234.57]) (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 5429AA0338; Wed, 17 Jul 2024 02:26:22 +0200 (CEST) Received: from samy by begin with local (Exim 4.98-RC3) (envelope-from ) id 1sTsUv-0000000CPa9-3mdX; Wed, 17 Jul 2024 02:26:21 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [PATCHv2] hurd: Fix missing pthread_ compat symbol in libc Date: Wed, 17 Jul 2024 02:26:20 +0200 Message-ID: <20240717002621.2958266-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.43.0 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~incoming=patchwork.ozlabs.org@sourceware.org 5476f8cd2e68 ("htl: move pthread_self info libc.") and 9dfa2562162b ("htl: move pthread_equal into libc") to 1dc0bc8f0748 ("htl: move pthread_attr_setdetachstate into libc") moved some pthread_ symbols from libpthread.so to libc.so, but missed adding the compat version like 5476f8cd2e68 ("htl: move pthread_self info libc.") did: libc already had these symbols as forwards, but versioned GLIBC_2.21, while the symbols in libpthread.so were versioned GLIBC_2.12. To fix running executables built before this, we thus have to add the GLIBC_2.12 version, otherwise execution fails with e.g. /usr/lib/i386-gnu/libglib-2.0.so: symbol lookup error: /usr/lib/i386-gnu/libglib-2.0.so: undefined symbol: pthread_attr_setinheritsched, version GLIBC_2.12 --- (Difference from v1: add forgotten pthread_attr_setinheritsched) htl/Versions | 10 ++++++++++ sysdeps/htl/pt-attr-getdetachstate.c | 7 ++++++- sysdeps/htl/pt-attr-getinheritsched.c | 7 ++++++- sysdeps/htl/pt-attr-getschedparam.c | 7 ++++++- sysdeps/htl/pt-attr-getschedpolicy.c | 7 ++++++- sysdeps/htl/pt-attr-setdetachstate.c | 7 ++++++- sysdeps/htl/pt-attr-setinheritsched.c | 6 +++++- sysdeps/htl/pt-attr-setschedpolicy.c | 7 ++++++- sysdeps/htl/pt-equal.c | 7 ++++++- sysdeps/htl/pt-getschedparam.c | 7 ++++++- sysdeps/htl/pt-setschedparam.c | 7 ++++++- sysdeps/mach/hurd/i386/libc.abilist | 10 ++++++++++ 12 files changed, 79 insertions(+), 10 deletions(-) diff --git a/htl/Versions b/htl/Versions index 710051756a..8dc460b280 100644 --- a/htl/Versions +++ b/htl/Versions @@ -3,6 +3,16 @@ libc { GLIBC_2.12 { pthread_self; __pthread_self; + pthread_attr_getdetachstate; + pthread_attr_getinheritsched; + pthread_attr_getschedparam; + pthread_attr_getschedpolicy; + pthread_attr_setdetachstate; + pthread_attr_setinheritsched; + pthread_attr_setschedpolicy; + pthread_equal; + pthread_getschedparam; + pthread_setschedparam; } GLIBC_2.21 { diff --git a/sysdeps/htl/pt-attr-getdetachstate.c b/sysdeps/htl/pt-attr-getdetachstate.c index 8b077e38f3..da27398260 100644 --- a/sysdeps/htl/pt-attr-getdetachstate.c +++ b/sysdeps/htl/pt-attr-getdetachstate.c @@ -17,6 +17,7 @@ . */ #include +#include #include int @@ -26,4 +27,8 @@ __pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstate) return 0; } -weak_alias (__pthread_attr_getdetachstate, pthread_attr_getdetachstate); +versioned_symbol (libc, __pthread_attr_getdetachstate, pthread_attr_getdetachstate, GLIBC_2_21); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_attr_getdetachstate, pthread_attr_getdetachstate, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pt-attr-getinheritsched.c b/sysdeps/htl/pt-attr-getinheritsched.c index 078face3eb..ba02e202c3 100644 --- a/sysdeps/htl/pt-attr-getinheritsched.c +++ b/sysdeps/htl/pt-attr-getinheritsched.c @@ -17,6 +17,7 @@ . */ #include +#include #include int @@ -26,4 +27,8 @@ __pthread_attr_getinheritsched (const pthread_attr_t *attr, int *inheritsched) return 0; } -weak_alias (__pthread_attr_getinheritsched, pthread_attr_getinheritsched); +versioned_symbol (libc, __pthread_attr_getinheritsched, pthread_attr_getinheritsched, GLIBC_2_21); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_attr_getinheritsched, pthread_attr_getinheritsched, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pt-attr-getschedparam.c b/sysdeps/htl/pt-attr-getschedparam.c index 3fa001871e..35eeedc442 100644 --- a/sysdeps/htl/pt-attr-getschedparam.c +++ b/sysdeps/htl/pt-attr-getschedparam.c @@ -19,6 +19,7 @@ #include #include #include +#include #include @@ -30,4 +31,8 @@ __pthread_attr_getschedparam (const pthread_attr_t *attr, return 0; } -weak_alias (__pthread_attr_getschedparam, pthread_attr_getschedparam); +versioned_symbol (libc, __pthread_attr_getschedparam, pthread_attr_getschedparam, GLIBC_2_21); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_attr_getschedparam, pthread_attr_getschedparam, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pt-attr-getschedpolicy.c b/sysdeps/htl/pt-attr-getschedpolicy.c index 8b4cc7ce48..5deaf01c5e 100644 --- a/sysdeps/htl/pt-attr-getschedpolicy.c +++ b/sysdeps/htl/pt-attr-getschedpolicy.c @@ -17,6 +17,7 @@ . */ #include +#include #include int @@ -26,4 +27,8 @@ __pthread_attr_getschedpolicy (const pthread_attr_t *attr, int *policy) return 0; } -weak_alias (__pthread_attr_getschedpolicy, pthread_attr_getschedpolicy); +versioned_symbol (libc, __pthread_attr_getschedpolicy, pthread_attr_getschedpolicy, GLIBC_2_21); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_attr_getschedpolicy, pthread_attr_getschedpolicy, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pt-attr-setdetachstate.c b/sysdeps/htl/pt-attr-setdetachstate.c index b40557f816..26b6f91dc6 100644 --- a/sysdeps/htl/pt-attr-setdetachstate.c +++ b/sysdeps/htl/pt-attr-setdetachstate.c @@ -17,6 +17,7 @@ . */ #include +#include #include int @@ -35,4 +36,8 @@ __pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate) return 0; } -weak_alias (__pthread_attr_setdetachstate, pthread_attr_setdetachstate); +versioned_symbol (libc, __pthread_attr_setdetachstate, pthread_attr_setdetachstate, GLIBC_2_21); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_attr_setdetachstate, pthread_attr_setdetachstate, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pt-attr-setinheritsched.c b/sysdeps/htl/pt-attr-setinheritsched.c index 533b805b12..c102b0cb12 100644 --- a/sysdeps/htl/pt-attr-setinheritsched.c +++ b/sysdeps/htl/pt-attr-setinheritsched.c @@ -35,4 +35,8 @@ __pthread_attr_setinheritsched (pthread_attr_t *attr, int inheritsched) return 0; } -weak_alias (__pthread_attr_setinheritsched, pthread_attr_setinheritsched); +versioned_symbol (libc, __pthread_attr_setinheritsched, pthread_attr_setinheritsched, GLIBC_2_21); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_attr_setinheritsched, pthread_attr_setinheritsched, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pt-attr-setschedpolicy.c b/sysdeps/htl/pt-attr-setschedpolicy.c index d8086e8316..9648c774d0 100644 --- a/sysdeps/htl/pt-attr-setschedpolicy.c +++ b/sysdeps/htl/pt-attr-setschedpolicy.c @@ -17,6 +17,7 @@ . */ #include +#include #include int @@ -39,4 +40,8 @@ __pthread_attr_setschedpolicy (pthread_attr_t *attr, int policy) return 0; } -weak_alias (__pthread_attr_setschedpolicy, pthread_attr_setschedpolicy); +versioned_symbol (libc, __pthread_attr_setschedpolicy, pthread_attr_setschedpolicy, GLIBC_2_21); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_attr_setschedpolicy, pthread_attr_setschedpolicy, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pt-equal.c b/sysdeps/htl/pt-equal.c index 6411110608..7727cca370 100644 --- a/sysdeps/htl/pt-equal.c +++ b/sysdeps/htl/pt-equal.c @@ -17,6 +17,7 @@ . */ #include +#include #include /* Return true if __T1 and __T2 both name the same thread. Otherwise, @@ -27,4 +28,8 @@ __pthread_equal (pthread_t __t1, pthread_t __t2) return __t1 == __t2; } -weak_alias (__pthread_equal, pthread_equal); +versioned_symbol (libc, __pthread_equal, pthread_equal, GLIBC_2_21); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_equal, pthread_equal, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pt-getschedparam.c b/sysdeps/htl/pt-getschedparam.c index 8ec3d54bd4..0c6a2d0ab3 100644 --- a/sysdeps/htl/pt-getschedparam.c +++ b/sysdeps/htl/pt-getschedparam.c @@ -17,6 +17,7 @@ . */ #include +#include #include int @@ -28,4 +29,8 @@ __pthread_getschedparam (pthread_t thread, int *policy, return 0; } -weak_alias (__pthread_getschedparam, pthread_getschedparam); +versioned_symbol (libc, __pthread_getschedparam, pthread_getschedparam, GLIBC_2_21); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_getschedparam, pthread_getschedparam, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pt-setschedparam.c b/sysdeps/htl/pt-setschedparam.c index aea4e7b0e4..5594c9f390 100644 --- a/sysdeps/htl/pt-setschedparam.c +++ b/sysdeps/htl/pt-setschedparam.c @@ -17,6 +17,7 @@ . */ #include +#include #include int @@ -26,5 +27,9 @@ __pthread_setschedparam (pthread_t thread, int policy, return ENOSYS; } -weak_alias (__pthread_setschedparam, pthread_setschedparam); +versioned_symbol (libc, __pthread_setschedparam, pthread_setschedparam, GLIBC_2_21); stub_warning (pthread_setschedparam) + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_setschedparam, pthread_setschedparam, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 2adf98e71d..dc2c6b505b 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -29,7 +29,17 @@ GLIBC_2.11 mkostemps64 F GLIBC_2.11 mkstemps F GLIBC_2.11 mkstemps64 F GLIBC_2.12 __pthread_self F +GLIBC_2.12 pthread_attr_getdetachstate F +GLIBC_2.12 pthread_attr_getinheritsched F +GLIBC_2.12 pthread_attr_getschedparam F +GLIBC_2.12 pthread_attr_getschedpolicy 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_equal F +GLIBC_2.12 pthread_getschedparam F GLIBC_2.12 pthread_self F +GLIBC_2.12 pthread_setschedparam F GLIBC_2.13 __fentry__ F GLIBC_2.14 syncfs F GLIBC_2.15 __fdelt_chk F