From patchwork Tue May 19 10:44:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 39302 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 3AB3F3948AA5; Tue, 19 May 2020 10:44:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3AB3F3948AA5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1589885073; bh=GuFIRXcQ2E0LzYBBqL7uN0lNgotbt4TU3LU8ruwn4dU=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=vhc6SW5eLVOMH9i9CkOgo0mwBhSeMmRxjczPTc6qgMTqwZ8vl1syG769nBSPpxmdL LbjXlDp/IPqcTi/w+4tX3WorGk/uGHCNsvo4SBdYtrE04V0d7uMeH/fPYJ4waOJZlY +8h69E+RCBwp1dbyPcTlAQxx3JdrjYux6LU6IJIQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by sourceware.org (Postfix) with ESMTP id E6C3F3948A69 for ; Tue, 19 May 2020 10:44:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E6C3F3948A69 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-17-O0a-lkQlPgC7FJyvMjCepA-1; Tue, 19 May 2020 06:44:28 -0400 X-MC-Unique: O0a-lkQlPgC7FJyvMjCepA-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 4A8388730E9 for ; Tue, 19 May 2020 10:44:27 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-113-18.ams2.redhat.com [10.36.113.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C37C86EA21 for ; Tue, 19 May 2020 10:44:26 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 06/19] nptl: Make __pthread_attr_init, __pthread_attr_destroy available internally In-Reply-To: References: Message-Id: Date: Tue, 19 May 2020 12:44:25 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (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 X-Spam-Status: No, score=-13.9 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_NONE, RCVD_IN_MSPIKE_H3, 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-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" pthread_attr_destroy needs to be a weak alias to avoid future linknamespace failures. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- nptl/Versions | 1 + nptl/pthreadP.h | 4 +++- nptl/pthread_attr_destroy.c | 3 ++- nptl/pthread_attr_init.c | 5 +++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/nptl/Versions b/nptl/Versions index ce08076611..65f0c077da 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -59,6 +59,7 @@ libc { # Used by the C11 threads implementation. __pthread_cond_destroy; __pthread_cond_init; __pthread_attr_setaffinity_np; + __pthread_attr_init; __pthread_attr_destroy; } } diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index ac0135422b..f218b01574 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -347,7 +347,8 @@ extern int __pthread_create_2_1 (pthread_t *newthread, extern int __pthread_create_2_0 (pthread_t *newthread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg); -extern int __pthread_attr_init_2_1 (pthread_attr_t *attr); +extern int __pthread_attr_init (pthread_attr_t *attr); +libc_hidden_proto (__pthread_attr_init) extern int __pthread_attr_init_2_0 (pthread_attr_t *attr); @@ -403,6 +404,7 @@ extern int __pthread_mutexattr_init (pthread_mutexattr_t *attr); extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *attr); extern int __pthread_mutexattr_settype (pthread_mutexattr_t *attr, int kind); extern int __pthread_attr_destroy (pthread_attr_t *attr); +libc_hidden_proto (__pthread_attr_destroy) extern int __pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstate); extern int __pthread_attr_setdetachstate (pthread_attr_t *attr, diff --git a/nptl/pthread_attr_destroy.c b/nptl/pthread_attr_destroy.c index d20f209377..21f8026a2c 100644 --- a/nptl/pthread_attr_destroy.c +++ b/nptl/pthread_attr_destroy.c @@ -39,4 +39,5 @@ __pthread_attr_destroy (pthread_attr_t *attr) return 0; } -strong_alias (__pthread_attr_destroy, pthread_attr_destroy) +libc_hidden_def (__pthread_attr_destroy) +weak_alias (__pthread_attr_destroy, pthread_attr_destroy) diff --git a/nptl/pthread_attr_init.c b/nptl/pthread_attr_init.c index f15cccab0a..acc22c64c4 100644 --- a/nptl/pthread_attr_init.c +++ b/nptl/pthread_attr_init.c @@ -29,7 +29,7 @@ int __attr_list_lock = LLL_LOCK_INITIALIZER; int -__pthread_attr_init_2_1 (pthread_attr_t *attr) +__pthread_attr_init (pthread_attr_t *attr) { struct pthread_attr *iattr; @@ -48,7 +48,8 @@ __pthread_attr_init_2_1 (pthread_attr_t *attr) return 0; } -versioned_symbol (libc, __pthread_attr_init_2_1, pthread_attr_init, GLIBC_2_1); +libc_hidden_def (__pthread_attr_init) +versioned_symbol (libc, __pthread_attr_init, pthread_attr_init, GLIBC_2_1); #if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_1)