From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id BCD693858C27 for ; Tue, 16 Mar 2021 05:42:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BCD693858C27 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-120-tlHaD5FqMJyWnX5x8qir2Q-1; Tue, 16 Mar 2021 01:42:26 -0400 X-MC-Unique: tlHaD5FqMJyWnX5x8qir2Q-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 934685F9CF; Tue, 16 Mar 2021 05:42:25 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA9B25D768; Tue, 16 Mar 2021 05:42:24 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 01/18] nptl: Move pthread_mutex_consistent into libc References: <22de850756d320f188c0ccd53e298b13768e0c49.1615569355.git.fweimer@redhat.com> <67d38097-51d3-e650-b327-7f9430090012@linaro.org> Date: Tue, 16 Mar 2021 06:42:30 +0100 In-Reply-To: <67d38097-51d3-e650-b327-7f9430090012@linaro.org> (Adhemerval Zanella's message of "Mon, 15 Mar 2021 16:30:57 -0300") Message-ID: <87a6r3slh5.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Mar 2021 05:42:30 -0000 * Adhemerval Zanella: >> index 937c7c4640..0a84063a2b 100644 >> --- a/nptl/pthread_mutex_consistent.c >> +++ b/nptl/pthread_mutex_consistent.c >> @@ -18,10 +18,10 @@ >> >> #include >> #include >> - >> +#include >> >> int >> -pthread_mutex_consistent (pthread_mutex_t *mutex) >> +__pthread_mutex_consistent (pthread_mutex_t *mutex) >> { >> /* Test whether this is a robust mutex with a dead owner. >> See concurrency notes regarding __kind in struct __pthread_mutex_s >> @@ -35,4 +35,20 @@ pthread_mutex_consistent (pthread_mutex_t *mutex) >> >> return 0; >> } >> -weak_alias (pthread_mutex_consistent, pthread_mutex_consistent_np) >> +versioned_symbol (libc, __pthread_mutex_consistent, pthread_mutex_consistent, >> + GLIBC_2_34); >> + >> +#if SHLIB_COMPAT (libc, GLIBC_2_4, GLIBC_2_34) > > Shouldn't be GLIBC_2_12 here? Where exactly? There are so many symbol versions. The _np variant was introduced in GLIBC_2.4, so GLIBC_2_4 is correct here. It ran parallel with the non-_np variant until GLIBC_2.34, so that's the end range. >> +/* Compat symbol with the old libc version, _np alias. */ >> +# undef pthread_mutex_consistent_np > > I think should be out of SHLIB_COMPAT. It will go away if I switch to __REDIRECT. >> +strong_alias (__pthread_mutex_consistent, __pthread_mutex_consistent_1) >> +compat_symbol (libc, __pthread_mutex_consistent_1, >> + pthread_mutex_consistent_np, GLIBC_2_4); >> +#endif >> + >> +#if SHLIB_COMPAT (libc, GLIBC_2_12, GLIBC_2_34) >> +/* Compat symbol with the old libc version. */ >> +strong_alias (__pthread_mutex_consistent, __pthread_mutex_consistent_2) >> +compat_symbol (libc, __pthread_mutex_consistent_2, >> + pthread_mutex_consistent, GLIBC_2_12); >> +#endif > > I think we have compat_symbol_unique exactly for that. It doesn't apply here because the symbol names are different (__pthread_mutex_consistent vs pthread_mutex_consistent): # define compat_symbol_unique(lib, name, version) \ The macro has just one name argument. >> diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h >> index a04a3a2754..2ec2caec98 100644 >> --- a/sysdeps/nptl/pthread.h >> +++ b/sysdeps/nptl/pthread.h >> @@ -809,8 +809,9 @@ extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, >> extern int pthread_mutex_consistent (pthread_mutex_t *__mutex) >> __THROW __nonnull ((1)); >> # ifdef __USE_GNU >> -extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex) >> - __THROW __nonnull ((1)); >> +# define pthread_mutex_consistent_np __glibc_macro_warning ("\ >> +pthread_mutex_consistent_np is deprecated, use pthread_mutex_consistent") \ >> + pthread_mutex_consistent >> # endif >> #endif >> > > Wouldn't be better to throw a link error instead an empty macro for such > case? It's not an empty macro, there's a third line. I can see if I can use __REDIRECT instead if that's clearer. Thanks, Florian