From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id 1C72A385AC3D for ; Mon, 31 Oct 2022 07:25:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1C72A385AC3D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=deneb.enyo.de Received: from [172.17.203.2] (port=55261 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1opPAJ-00B4Qx-J3; Mon, 31 Oct 2022 07:24:59 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.94.2) (envelope-from ) id 1opPAJ-0003l1-6J; Mon, 31 Oct 2022 08:24:59 +0100 From: Florian Weimer To: Guy-Fleury Iteriteka via Libc-alpha Cc: Guy-Fleury Iteriteka Subject: Re: [PATCH 4/4] htl: move pthread_self into libc References: <20221029120030.1448-1-gfleury@disroot.org> <20221029120030.1448-5-gfleury@disroot.org> Date: Mon, 31 Oct 2022 08:24:59 +0100 In-Reply-To: <20221029120030.1448-5-gfleury@disroot.org> (Guy-Fleury Iteriteka via Libc-alpha's message of "Sat, 29 Oct 2022 13:00:30 +0100") Message-ID: <87cza8jvzo.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,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 List-Id: * Guy-Fleury Iteriteka via Libc-alpha: > diff --git a/htl/Versions b/htl/Versions > index 1ef8a6d0..59070181 100644 > --- a/htl/Versions > +++ b/htl/Versions > @@ -25,7 +25,9 @@ libc { > GLIBC_2.32 { > thrd_current; thrd_equal; thrd_sleep; thrd_yield; > } > - > + GLIBC_2.36 { > + __pthread_self; > + } This needs to be GLIBC_2.37 now. I think it also needs to be pthread_self (the public symbol). > diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386= /libc.abilist > index 26552958..bfa47282 100644 > --- a/sysdeps/mach/hurd/i386/libc.abilist > +++ b/sysdeps/mach/hurd/i386/libc.abilist > @@ -29,6 +29,7 @@ GLIBC_2.11 mkostemps64 F > GLIBC_2.11 mkstemps F > GLIBC_2.11 mkstemps64 F > GLIBC_2.12 pthread_equal F > +GLIBC_2.12 pthread_self F > GLIBC_2.13 __fentry__ F > GLIBC_2.14 syncfs F > GLIBC_2.15 __fdelt_chk F =E2=80=9CGLIBC_2.37 pthread_self=E2=80=9D needs to show up there, in additi= on to the GLIBC_2.12 version. What's missing from this change is the construct for setting the symbol versions, something like: versioned_symbol (libc, __pthread_self, pthread_self, GLIBC_2_37); #if OTHER_SHLIB_COMPAT (librt, GLIBC_2_12, GLIBC_2_37) compat_symbol (libc, __pthread_self, pthread_self, GLIBC_2_12); #endif This sets the new symbol version explicitly and provides the old version as a compatibility symbol. It may be necessary to introduce a hidden prototype for __pthread_self, to avoid check-localplt warnings. You may have to use libc_hidden_ver and a different name in the C function definition to work around some symbol management limitations. Another approach could use an inline function for pthread_self or __pthread_self, so that glibc-internal use of the symbol goes away completely. Use of a __thread variable for ___pthread_self is problematic because it interferes with dlmopen. If you use THREAD_GETMEM instead, I believe you can do away with the conditional check in pthread_self.