From patchwork Wed Feb 17 17:21:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 42090 X-Patchwork-Delegate: azanella@linux.vnet.ibm.com 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 E7AA13947410; Wed, 17 Feb 2021 17:21:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E7AA13947410 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1613582481; bh=0/WnrfI/4BRKmvkE+Usm4tB4HlFIwwVdN05tjtpOA4g=; 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=XluXcQ7wZIBfVS6gxy4H07HcBZkdGFGNtgLH/YlQYGe9sJu74itYzgSIE2h724A4H PtzITFqsGc0gySjePg9EEdDlW5ab8hLDogaRn+MVdOy+M3QxrrzBW6vmCLcwwBq64Y gh20jQV8rD4MU7Wq3JzqG6Z/ocb6byq0eSqtsMvg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 8CBC33947404 for ; Wed, 17 Feb 2021 17:21:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8CBC33947404 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-150-67eQwvmlP8OycvrHNt-tyw-1; Wed, 17 Feb 2021 12:21:14 -0500 X-MC-Unique: 67eQwvmlP8OycvrHNt-tyw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1EF246EE20 for ; Wed, 17 Feb 2021 17:21:14 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-131.ams2.redhat.com [10.36.113.131]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 44C7C5D9D2 for ; Wed, 17 Feb 2021 17:21:13 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 4/6] nptl: Move lowlevellock into libc In-Reply-To: References: Message-Id: <391746b22a4a3d5ccc71fbdf312bce0826a1792a.1613582255.git.fweimer@redhat.com> Date: Wed, 17 Feb 2021 18:21:45 +0100 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.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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-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" And export __lll_lock_wait and __lll_lock_wait_private as GLIBC_PRIVATE. This should eliminate the need for the previous riscv kludge. --- nptl/Makefile | 3 +-- nptl/Versions | 2 ++ nptl/libc-lowlevellock.c | 20 -------------------- nptl/lowlevellock.c | 6 ++---- sysdeps/nptl/lowlevellock.h | 6 ++++-- sysdeps/riscv/nptl/libc-lowlevellock.c | 8 -------- 6 files changed, 9 insertions(+), 36 deletions(-) delete mode 100644 nptl/libc-lowlevellock.c delete mode 100644 sysdeps/riscv/nptl/libc-lowlevellock.c diff --git a/nptl/Makefile b/nptl/Makefile index 5a7558d943..62f368af1e 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -33,9 +33,9 @@ routines = \ forward \ libc-cancellation \ libc-cleanup \ - libc-lowlevellock \ libc_multiple_threads \ libc_pthread_init \ + lowlevellock \ old_pthread_cond_destroy \ old_pthread_cond_init \ pthread_atfork \ @@ -100,7 +100,6 @@ libpthread-routines = \ futex-internal \ herrno \ libpthread-compat \ - lowlevellock \ nptl-init \ nptlfreeres \ old_pthread_atfork \ diff --git a/nptl/Versions b/nptl/Versions index 7254ca4750..694747bb44 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -77,6 +77,8 @@ libc { __libc_current_sigrtmin_private; __libc_dl_error_tsd; __libc_pthread_init; + __lll_lock_wait; + __lll_lock_wait_private; __pthread_attr_copy; __pthread_attr_destroy; __pthread_attr_init; diff --git a/nptl/libc-lowlevellock.c b/nptl/libc-lowlevellock.c deleted file mode 100644 index e840399c41..0000000000 --- a/nptl/libc-lowlevellock.c +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2003-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Paul Mackerras , 2003. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -/* No difference to lowlevellock.c, except we lose a couple of functions. */ -#include diff --git a/nptl/lowlevellock.c b/nptl/lowlevellock.c index 1ea397d5cb..7976c6d8f5 100644 --- a/nptl/lowlevellock.c +++ b/nptl/lowlevellock.c @@ -35,10 +35,8 @@ __lll_lock_wait_private (int *futex) futex_wait ((unsigned int *) futex, 2, LLL_PRIVATE); /* Wait if *futex == 2. */ } } +libc_hidden_def (__lll_lock_wait_private) - -/* This function doesn't get included in libc. */ -#if IS_IN (libpthread) void __lll_lock_wait (int *futex, int private) { @@ -52,4 +50,4 @@ __lll_lock_wait (int *futex, int private) futex_wait ((unsigned int *) futex, 2, private); /* Wait if *futex == 2. */ } } -#endif +libc_hidden_def (__lll_lock_wait) diff --git a/sysdeps/nptl/lowlevellock.h b/sysdeps/nptl/lowlevellock.h index 0a2b413f86..176ba96251 100644 --- a/sysdeps/nptl/lowlevellock.h +++ b/sysdeps/nptl/lowlevellock.h @@ -75,8 +75,10 @@ #define lll_cond_trylock(lock) \ __glibc_unlikely (atomic_compare_and_exchange_bool_acq (&(lock), 2, 0)) -extern void __lll_lock_wait_private (int *futex) attribute_hidden; -extern void __lll_lock_wait (int *futex, int private) attribute_hidden; +extern void __lll_lock_wait_private (int *futex); +libc_hidden_proto (__lll_lock_wait_private) +extern void __lll_lock_wait (int *futex, int private); +libc_hidden_proto (__lll_lock_wait) /* This is an expression rather than a statement even though its value is void, so that it can be used in a comma expression or as an expression diff --git a/sysdeps/riscv/nptl/libc-lowlevellock.c b/sysdeps/riscv/nptl/libc-lowlevellock.c deleted file mode 100644 index 9523fb46a5..0000000000 --- a/sysdeps/riscv/nptl/libc-lowlevellock.c +++ /dev/null @@ -1,8 +0,0 @@ -/* This kludge works around a libpthread static linking problem: - https://sourceware.org/bugzilla/show_bug.cgi?id=15648. */ - -#ifndef SHARED -# define __lll_lock_wait_private weak_function __lll_lock_wait_private -#endif - -#include