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 00/10] nptl: Complete libpthread removal
Date: Tue, 18 May 2021 16:24:43 +0200	[thread overview]
Message-ID: <cover.1621347402.git.fweimer@redhat.com> (raw)

This series finally removes libpthread for Linux/NPTL.

The first patch supersedes “nptl: Introduce __nptl_deferred_init”.  I
think doing cancel initialization on pthread_cancel is not an
improvement because we would have to use another flag to avoid the extra
system calls.  The next two patches were posted previous; Adhemerval
already reviewed them.

One test had to be adjusted because it use libpthread as the canonical
NODELETE object.

We need to provide libpthread.so.0 stub object for use with
memusagestat, otherwise a system libpthread.so.0 might leak into the
link.  Not loading libpthread.so.0 is hacked directly into the dynamic
loader.

For some reason, pthread debugging still works even without libpthread
loaded.  I didn't have to add the fake libpthread.so.0 link map to
trigger loading of libthread_db in GDB.  Testing with systemtap and
dyninst will happen once we get this into Fedora rawhide.

I have built and tested various intermediate steps (i686-linux-gnu,
x86_64-linux-gnu, build-many-glibcs.py).  In particular, the placeholder
symbols in the code-less libpthread match the abilist files.

Thanks,
Florian

Florian Weimer (10):
  nptl: Perform signal initialization upon pthread_create
  nptl: Eliminate the __static_tls_size, __static_tls_align_m1 variables
  nptl: Move semi-public __pthread_get_minstack symbol into libc
  elf: Use custom NODELETE DSO for tst-dlopenfail, tst-dlopenfail-2
  nptl: Move pthread_create, thrd_create into libc
  nptl: Remove unused __libc_pthread_init function
  nptl: Remove remaining code from libpthread
  elf: Do not load libpthread for PTHREAD_IN_LIBC
  elf: Add facility to create stub DSOs in elf/stub-dsos
  nptl: Stop building libpthread

 Makeconfig                                    |  13 +-
 elf/Makefile                                  |  29 ++-
 elf/dl-load.c                                 |  19 +-
 elf/dl-tls.c                                  |   5 +-
 elf/dl-version.c                              |   9 +
 nptl/version.c => elf/lib-stub.S              |  31 +--
 elf/tst-dlopenfail-2.c                        |   5 +-
 elf/tst-dlopenfail.c                          |  44 ++---
 elf/tst-dlopenfailmod2.c                      |   6 +-
 .../tst-dlopenfailnodelmod.c                  |  24 +--
 include/libc-internal.h                       |   6 +-
 nptl/Makefile                                 |  77 +-------
 nptl/Versions                                 |  33 ++--
 nptl/allocatestack.c                          |  25 +--
 nptl/libpthread-compat.c                      | 112 -----------
 nptl/libpthread-stub.S                        |   1 +
 nptl/nptl-init.c                              | 180 ------------------
 nptl/nptl-stack.c                             |  17 ++
 nptl/nptl-stack.h                             |  11 +-
 nptl/pt-crti.S                                |  50 -----
 nptl/pt-interp.c                              |   1 -
 nptl/pthreadP.h                               |  18 +-
 nptl/pthread_cancel.c                         |  88 ++++++++-
 nptl/pthread_create.c                         |  60 +++++-
 nptl/pthread_getattr_default_np.c             |   6 +-
 nptl_db/Makefile                              |   2 +-
 nptl_db/structs.def                           |  10 +-
 sysdeps/arm/nptl-aeabi_unwind_cpp_pr1.c       |   1 -
 sysdeps/arm/nptl/Makefile                     |   3 -
 sysdeps/ia64/nptl/Makefile                    |   5 -
 sysdeps/mips/Makefile                         |   5 -
 sysdeps/mips/nptl/Makefile                    |   5 -
 sysdeps/mips/nptl/nptl-sysdep.S               |   2 -
 sysdeps/nptl/Makeconfig                       |   7 +-
 sysdeps/nptl/Makefile                         |   4 -
 sysdeps/nptl/pthread_early_init.h             |  28 +++
 sysdeps/nptl/thrd_create.c                    |   2 -
 sysdeps/pthread/Makefile                      |   3 +-
 sysdeps/pthread/thrd_create.c                 |  11 +-
 sysdeps/riscv/nptl/Makefile                   |   5 -
 sysdeps/riscv/nptl/nptl-sysdep.S              |   2 -
 sysdeps/s390/nptl/Makefile                    |   5 -
 sysdeps/sparc/Makefile                        |   4 -
 sysdeps/sparc/nptl/Makefile                   |   5 -
 sysdeps/unix/sysv/linux/aarch64/libc.abilist  |   4 +
 .../sysv/linux/aarch64/libpthread.abilist     |   6 -
 sysdeps/unix/sysv/linux/alpha/Makefile        |   6 -
 sysdeps/unix/sysv/linux/alpha/libc.abilist    |   5 +
 .../unix/sysv/linux/alpha/libpthread.abilist  |  18 --
 sysdeps/unix/sysv/linux/arc/libc.abilist      |   4 +
 .../unix/sysv/linux/arc/libpthread.abilist    |   3 -
 sysdeps/unix/sysv/linux/arm/Makefile          |   5 -
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |   4 +
 .../unix/sysv/linux/arm/be/libpthread.abilist |   9 -
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |   4 +
 .../unix/sysv/linux/arm/le/libpthread.abilist |   9 -
 sysdeps/unix/sysv/linux/csky/libc.abilist     |   4 +
 .../unix/sysv/linux/csky/libpthread.abilist   |   5 -
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |   4 +
 .../unix/sysv/linux/hppa/libpthread.abilist   |  14 --
 sysdeps/unix/sysv/linux/i386/Makefile         |  11 --
 sysdeps/unix/sysv/linux/i386/libc.abilist     |   5 +
 .../unix/sysv/linux/i386/libpthread.abilist   |  18 --
 sysdeps/unix/sysv/linux/ia64/libc.abilist     |   4 +
 .../unix/sysv/linux/ia64/libpthread.abilist   |  14 --
 .../sysv/linux/m68k/coldfire/libc.abilist     |   4 +
 .../linux/m68k/coldfire/libpthread.abilist    |   9 -
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |   5 +
 .../sysv/linux/m68k/m680x0/libpthread.abilist |  18 --
 sysdeps/unix/sysv/linux/microblaze/Makefile   |   6 -
 .../sysv/linux/microblaze/be/libc.abilist     |   4 +
 .../linux/microblaze/be/libpthread.abilist    |   5 -
 .../sysv/linux/microblaze/le/libc.abilist     |   4 +
 .../linux/microblaze/le/libpthread.abilist    |   5 -
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |   5 +
 .../sysv/linux/mips/mips32/libpthread.abilist |  15 --
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |   5 +
 .../sysv/linux/mips/mips64/libpthread.abilist |  15 --
 .../sysv/linux/mips/mips64/n32/libc.abilist   |   5 +
 .../sysv/linux/mips/mips64/n64/libc.abilist   |   5 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |   4 +
 .../unix/sysv/linux/nios2/libpthread.abilist  |   5 -
 sysdeps/unix/sysv/linux/powerpc/Makefile      |   5 -
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |   5 +
 .../powerpc/powerpc32/libpthread.abilist      |  19 --
 .../powerpc/powerpc32/nofpu/libc.abilist      |   5 +
 .../linux/powerpc/powerpc64/be/libc.abilist   |   4 +
 .../powerpc/powerpc64/be/libpthread.abilist   |  13 --
 .../linux/powerpc/powerpc64/le/libc.abilist   |   4 +
 .../powerpc/powerpc64/le/libpthread.abilist   |   6 -
 .../unix/sysv/linux/riscv/rv32/libc.abilist   |   4 +
 .../sysv/linux/riscv/rv32/libpthread.abilist  |   3 -
 .../unix/sysv/linux/riscv/rv64/libc.abilist   |   4 +
 .../sysv/linux/riscv/rv64/libpthread.abilist  |   5 -
 .../unix/sysv/linux/s390/s390-32/libc.abilist |   5 +
 .../linux/s390/s390-32/libpthread.abilist     |  19 --
 .../unix/sysv/linux/s390/s390-64/libc.abilist |   4 +
 .../linux/s390/s390-64/libpthread.abilist     |  15 --
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |   4 +
 .../unix/sysv/linux/sh/be/libpthread.abilist  |  14 --
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |   4 +
 .../unix/sysv/linux/sh/le/libpthread.abilist  |  14 --
 sysdeps/unix/sysv/linux/sparc/Makefile        |   6 -
 .../sysv/linux/sparc/sparc32/libc.abilist     |   5 +
 .../linux/sparc/sparc32/libpthread.abilist    |  18 --
 .../sysv/linux/sparc/sparc64/libc.abilist     |   4 +
 .../linux/sparc/sparc64/libpthread.abilist    |  14 --
 .../unix/sysv/linux/x86_64/64/libc.abilist    |   4 +
 .../sysv/linux/x86_64/64/libpthread.abilist   |  13 --
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |   4 +
 .../sysv/linux/x86_64/x32/libpthread.abilist  |   6 -
 111 files changed, 510 insertions(+), 974 deletions(-)
 rename nptl/version.c => elf/lib-stub.S (51%)
 rename nptl/libc_pthread_init.c => elf/tst-dlopenfailnodelmod.c (61%)
 delete mode 100644 nptl/libpthread-compat.c
 create mode 100644 nptl/libpthread-stub.S
 delete mode 100644 nptl/nptl-init.c
 delete mode 100644 nptl/pt-crti.S
 delete mode 100644 nptl/pt-interp.c
 delete mode 100644 sysdeps/arm/nptl-aeabi_unwind_cpp_pr1.c
 delete mode 100644 sysdeps/mips/nptl/nptl-sysdep.S
 delete mode 100644 sysdeps/nptl/thrd_create.c
 delete mode 100644 sysdeps/riscv/nptl/nptl-sysdep.S
 delete mode 100644 sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/alpha/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/arc/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/csky/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/hppa/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/i386/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/ia64/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/nios2/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
 delete mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist

-- 
2.31.1


             reply	other threads:[~2021-05-18 14:25 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 14:24 Florian Weimer [this message]
2021-05-18 14:24 ` [PATCH 01/10] nptl: Perform signal initialization upon pthread_create Florian Weimer
2021-05-20 19:15   ` Adhemerval Zanella
2021-05-20 19:41     ` Florian Weimer
2021-05-20 19:57       ` Adhemerval Zanella
2021-05-20 20:05         ` Florian Weimer
2021-05-20 20:32           ` Adhemerval Zanella
2021-05-21  9:58             ` Florian Weimer
2021-05-21 11:31               ` Adhemerval Zanella
2021-05-21 12:40                 ` Adhemerval Zanella
2021-05-18 14:24 ` [PATCH 02/10] nptl: Eliminate the __static_tls_size, __static_tls_align_m1 variables Florian Weimer
2021-05-18 14:25 ` [PATCH 03/10] nptl: Move semi-public __pthread_get_minstack symbol into libc Florian Weimer
2021-05-18 14:25 ` [PATCH 04/10] elf: Use custom NODELETE DSO for tst-dlopenfail, tst-dlopenfail-2 Florian Weimer
2021-05-20 20:36   ` Adhemerval Zanella
2021-05-18 14:25 ` [PATCH 05/10] nptl: Move pthread_create, thrd_create into libc Florian Weimer
2021-05-20 20:44   ` Adhemerval Zanella
2021-05-18 14:25 ` [PATCH 06/10] nptl: Remove unused __libc_pthread_init function Florian Weimer
2021-05-18 14:49   ` Andreas Schwab
2021-05-18 14:25 ` [PATCH 07/10] nptl: Remove remaining code from libpthread Florian Weimer
2021-05-20 20:49   ` Adhemerval Zanella
2021-05-18 14:25 ` [PATCH 08/10] elf: Do not load libpthread for PTHREAD_IN_LIBC Florian Weimer
2021-05-20 20:53   ` Adhemerval Zanella
2021-05-21 19:15     ` Florian Weimer
2021-05-18 14:25 ` [PATCH 09/10] elf: Add facility to create stub DSOs in elf/stub-dsos Florian Weimer
2021-05-24 18:24   ` Adhemerval Zanella
2021-05-24 18:25     ` Adhemerval Zanella
2021-05-18 14:25 ` [PATCH 10/10] nptl: Stop building libpthread Florian Weimer
2021-05-18 14:56 ` [PATCH 00/10] nptl: Complete libpthread removal Andreas Schwab
2021-05-18 15:04   ` Florian Weimer
2021-05-18 15:26     ` Andreas Schwab
2021-05-18 15:51       ` Florian Weimer
2021-05-18 16:27         ` Andreas Schwab
2021-05-18 16:31           ` Florian Weimer
2021-05-18 16:47             ` Andreas Schwab
2021-05-20 13:27               ` Florian Weimer
2021-05-20 13:50                 ` Andreas Schwab
2021-05-20 13:54                   ` Florian Weimer
2021-05-20 14:01                     ` Andreas Schwab
2021-05-20 15:09                     ` H.J. Lu
2021-05-20 15:13                       ` Florian Weimer
2021-05-20 15:17                       ` Andreas Schwab
2021-05-20 15:35                         ` H.J. Lu
2021-05-20 15:39                           ` Florian Weimer
2021-05-20 15:57                             ` H.J. Lu
2021-05-19 11:57 ` Szabolcs Nagy
2021-05-19 12:35   ` Florian Weimer
2021-05-19 13:14     ` Szabolcs Nagy

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=cover.1621347402.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).