public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: libc-alpha@sourceware.org
Subject: [PATCH 4/6] nptl: Move lowlevellock into libc
Date: Wed, 17 Feb 2021 18:21:45 +0100	[thread overview]
Message-ID: <391746b22a4a3d5ccc71fbdf312bce0826a1792a.1613582255.git.fweimer@redhat.com> (raw)
In-Reply-To: <cover.1613582255.git.fweimer@redhat.com>

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 <paulus@au.ibm.com>, 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
-   <https://www.gnu.org/licenses/>.  */
-
-/* No difference to lowlevellock.c, except we lose a couple of functions.  */
-#include <lowlevellock.c>
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 <lowlevellock.c>
-- 
2.29.2



  parent reply	other threads:[~2021-02-17 17:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17 17:21 [PATCH 0/6] More libpthread removal preparations Florian Weimer
2021-02-17 17:21 ` [PATCH 1/6] nptl: Split libpthread-routines into one routine per line Florian Weimer
2021-02-22 14:23   ` Adhemerval Zanella
2021-02-17 17:21 ` [PATCH 2/6] nptl: Reformat Versions Florian Weimer
2021-02-22 16:31   ` Adhemerval Zanella
2021-02-17 17:21 ` [PATCH 3/6] nptl: Move futex-internal.c into main nptl directory Florian Weimer
2021-02-22 16:34   ` Adhemerval Zanella
2021-02-17 17:21 ` Florian Weimer [this message]
2021-02-22 16:38   ` [PATCH 4/6] nptl: Move lowlevellock into libc Adhemerval Zanella
2021-02-22 16:46     ` Florian Weimer
2021-02-17 17:21 ` [PATCH 5/6] nptl: Move futex-internal " Florian Weimer
2021-02-22 16:39   ` Adhemerval Zanella
2021-02-17 17:22 ` [PATCH 6/6] nptl: Move elision implementations " Florian Weimer
2021-02-22 16:53   ` Adhemerval Zanella
2021-02-22 17:02     ` Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=391746b22a4a3d5ccc71fbdf312bce0826a1792a.1613582255.git.fweimer@redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).