[00/18] Repost of pending libpthread removal patches

Message ID cover.1615569355.git.fweimer@redhat.com
Headers show
Series
  • Repost of pending libpthread removal patches
Related show

Message

This series is a repost of:

  <https://sourceware.org/pipermail/libc-alpha/2021-March/123202.html>

I've made some minor cleanups (removal of weak declarations of symbols
moved to libc from sysdeps/nptl/libc-lockP.h; this should help with
static linking of libpthread without crashes eventually).  I had to move
pthread_once before __pthread_unwind_next because of its _Unwind_Resume
dependency.  The patches after __pthread_unwind_next are new and remove
forwarder functionality, and also move pthread_exit.

As discussed on the GDB list, the nptl_db support for pthread_key_create
is unused by GDB, so I could not write a test for this.

Tested on i686-linux-gnu x86_64-linux-gnu.  Built with
build-many-glibcs.py.

Thanks,
Florian

Florian Weimer (18):
  nptl: Move pthread_mutex_consistent into libc
  nptl: Move __pthread_cleanup_routine into libc
  nptl: Move legacy unwinding implementation into libc
  nptl: Move legacy cancelation handling into libc as compat symbols
  nptl: Remove longjmp, siglongjmp from libpthread
  Legacy unwinder: Remove definition of _Unwind_GetCFA
  nptl: Move __pthread_cleanup_upto into libc
  nptl: Move pthread_once and __pthread_once into libc
  nptl: Move __pthread_unwind_next into libc
  csu: Move calling main out of __libc_start_main_impl
  nptl: Move internal __nptl_nthreads variable into libc
  nptl_db: Introduce DB_MAIN_ARRAY_VARIABLE
  nptl: Move __pthread_keys global variable into libc
  nptl: Move __nptl_deallocate_tsd into libc
  nptl: Move pthread_exit into libc
  nptl: Move pthread_setcancelstate into libc
  nptl: Move pthread_setcanceltype into libc
  nptl: Invoke the set_robust_list system call directly in fork

 NEWS                                          |   4 +-
 csu/libc-start.c                              |  74 +-----------
 elf/Makefile                                  |   2 +
 include/setjmp.h                              |   4 +-
 libio/iopopen.c                               |   5 +-
 misc/error.c                                  |  19 +--
 nptl/Makefile                                 |  48 +++++---
 nptl/Versions                                 |  48 +++++---
 nptl/cleanup_compat.c                         |  16 ++-
 nptl/cleanup_defer_compat.c                   |  72 +++--------
 nptl/cleanup_routine.c                        |  12 +-
 nptl/forward.c                                |  28 -----
 nptl/libc-cleanup.c                           |  64 +++++++++-
 nptl/libc_pthread_init.c                      |   9 +-
 nptl/nptl-init.c                              |  34 +-----
 nptl/nptl_deallocate_tsd.c                    | 112 ++++++++++++++++++
 .../nptl_nthreads.c                           |  19 +--
 nptl/pt-longjmp.c                             |  49 --------
 nptl/pthreadP.h                               |  48 ++++----
 nptl/pthread_cancel.c                         |  10 +-
 nptl/{pt-cleanup.c => pthread_cleanup_upto.c} |   2 +-
 nptl/pthread_create.c                         |  98 ---------------
 nptl/pthread_exit.c                           |  16 ++-
 nptl/pthread_keys.c                           |  24 ++++
 nptl/pthread_mutex_consistent.c               |  22 +++-
 nptl/pthread_once.c                           |  22 +++-
 nptl/pthread_setcancelstate.c                 |   6 +-
 nptl/pthread_setcanceltype.c                  |   3 +-
 nptl/tst-cleanup4.c                           |   5 +
 nptl/tst-cleanup4aux.c                        |   5 +
 nptl/tst-pthread_exit-nothreads-static.c      |  19 +++
 nptl/tst-pthread_exit-nothreads.c             |  28 +++++
 nptl/unwind.c                                 |  14 ++-
 nptl/vars.c                                   |   5 -
 nptl_db/db-symbols.awk                        |   1 +
 nptl_db/structs.def                           |   9 +-
 setjmp/Versions                               |   4 -
 stdlib/fmtmsg.c                               |   9 +-
 sysdeps/arm/Makefile                          |   5 -
 sysdeps/arm/nptl/unwind-forcedunwind.c        |  25 ----
 sysdeps/generic/libc_start_call_main.h        |  24 ++++
 sysdeps/generic/unwind-dw2.c                  |   8 --
 sysdeps/generic/unwind-resume.c               |  14 +++
 .../unwind-resume.c}                          |   5 +-
 sysdeps/nptl/fork.c                           |  14 +--
 sysdeps/nptl/fork.h                           |   3 -
 sysdeps/nptl/jmp-unwind.c                     |   8 +-
 sysdeps/nptl/libc-lock.h                      |  59 ++++-----
 sysdeps/nptl/libc-lockP.h                     |  45 +------
 sysdeps/nptl/libc_start_call_main.h           |  74 ++++++++++++
 sysdeps/nptl/pthread-functions.h              |  15 ---
 sysdeps/nptl/pthread.h                        |   5 +-
 sysdeps/nptl/unwind-forcedunwind.c            |  64 ----------
 sysdeps/posix/system.c                        |   5 +-
 sysdeps/pthread/Makefile                      |   2 +-
 sysdeps/pthread/tst-robust1.c                 |   4 +-
 sysdeps/pthread/tst-robust8.c                 |   2 +-
 sysdeps/pthread/tst-robust9.c                 |   4 +-
 sysdeps/unix/sysv/linux/aarch64/libc.abilist  |  15 +++
 .../sysv/linux/aarch64/libpthread.abilist     |  15 ---
 sysdeps/unix/sysv/linux/alpha/libc.abilist    |  15 +++
 .../unix/sysv/linux/alpha/libpthread.abilist  |  15 ---
 sysdeps/unix/sysv/linux/arc/libc.abilist      |  15 +++
 .../unix/sysv/linux/arc/libpthread.abilist    |  13 --
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  15 +++
 .../unix/sysv/linux/arm/be/libpthread.abilist |  15 ---
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  15 +++
 .../unix/sysv/linux/arm/le/libpthread.abilist |  15 ---
 sysdeps/unix/sysv/linux/csky/libc.abilist     |  15 +++
 .../unix/sysv/linux/csky/libpthread.abilist   |  13 --
 sysdeps/unix/sysv/linux/fatal-prepare.h       |   4 +-
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |  15 +++
 .../unix/sysv/linux/hppa/libpthread.abilist   |  15 ---
 sysdeps/unix/sysv/linux/i386/libc.abilist     |  15 +++
 .../unix/sysv/linux/i386/libpthread.abilist   |  15 ---
 sysdeps/unix/sysv/linux/ia64/Makefile         |   2 +-
 sysdeps/unix/sysv/linux/ia64/libc.abilist     |  15 +++
 .../unix/sysv/linux/ia64/libpthread.abilist   |  15 ---
 .../sysv/linux/m68k/coldfire/libc.abilist     |  15 +++
 .../linux/m68k/coldfire/libpthread.abilist    |  15 ---
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  15 +++
 .../sysv/linux/m68k/m680x0/libpthread.abilist |  15 ---
 .../sysv/linux/microblaze/be/libc.abilist     |  15 +++
 .../linux/microblaze/be/libpthread.abilist    |  15 ---
 .../sysv/linux/microblaze/le/libc.abilist     |  15 +++
 .../linux/microblaze/le/libpthread.abilist    |  15 ---
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |  15 +++
 .../sysv/linux/mips/mips32/libpthread.abilist |  15 ---
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  15 +++
 .../sysv/linux/mips/mips64/libpthread.abilist |  15 ---
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  15 +++
 .../sysv/linux/mips/mips64/n64/libc.abilist   |  15 +++
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |  15 +++
 .../unix/sysv/linux/nios2/libpthread.abilist  |  15 ---
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  15 +++
 .../powerpc/powerpc32/libpthread.abilist      |  17 ---
 .../powerpc/powerpc32/nofpu/libc.abilist      |  15 +++
 .../linux/powerpc/powerpc64/be/libc.abilist   |  15 +++
 .../powerpc/powerpc64/be/libpthread.abilist   |  17 ---
 .../linux/powerpc/powerpc64/le/libc.abilist   |  15 +++
 .../powerpc/powerpc64/le/libpthread.abilist   |  15 ---
 sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c  |  61 ----------
 .../unix/sysv/linux/riscv/rv32/libc.abilist   |  15 +++
 .../sysv/linux/riscv/rv32/libpthread.abilist  |  13 --
 .../unix/sysv/linux/riscv/rv64/libc.abilist   |  15 +++
 .../sysv/linux/riscv/rv64/libpthread.abilist  |  13 --
 sysdeps/unix/sysv/linux/s390/Versions         |   2 +-
 sysdeps/unix/sysv/linux/s390/jmp-unwind.c     |   7 +-
 .../unix/sysv/linux/s390/libpthread-compat.c  |  25 ++++
 sysdeps/unix/sysv/linux/s390/pt-longjmp.c     |  33 ------
 .../unix/sysv/linux/s390/s390-32/libc.abilist |  15 +++
 .../linux/s390/s390-32/libpthread.abilist     |  18 +--
 .../unix/sysv/linux/s390/s390-64/libc.abilist |  15 +++
 .../linux/s390/s390-64/libpthread.abilist     |  18 +--
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  15 +++
 .../unix/sysv/linux/sh/be/libpthread.abilist  |  15 ---
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  15 +++
 .../unix/sysv/linux/sh/le/libpthread.abilist  |  15 ---
 .../sysv/linux/sparc/sparc32/libc.abilist     |  15 +++
 .../linux/sparc/sparc32/libpthread.abilist    |  15 ---
 .../sysv/linux/sparc/sparc64/libc.abilist     |  15 +++
 .../linux/sparc/sparc64/libpthread.abilist    |  15 ---
 sysdeps/unix/sysv/linux/spawni.c              |   5 +-
 .../unix/sysv/linux/x86_64/64/libc.abilist    |  15 +++
 .../sysv/linux/x86_64/64/libpthread.abilist   |  15 ---
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |  15 +++
 .../sysv/linux/x86_64/x32/libpthread.abilist  |  15 ---
 sysdeps/x86/nptl/pt-longjmp.c                 |  71 -----------
 128 files changed, 1169 insertions(+), 1312 deletions(-)
 create mode 100644 nptl/nptl_deallocate_tsd.c
 rename sysdeps/arm/pt-arm-unwind-resume.S => nptl/nptl_nthreads.c (51%)
 delete mode 100644 nptl/pt-longjmp.c
 rename nptl/{pt-cleanup.c => pthread_cleanup_upto.c} (98%)
 create mode 100644 nptl/pthread_keys.c
 create mode 100644 nptl/tst-pthread_exit-nothreads-static.c
 create mode 100644 nptl/tst-pthread_exit-nothreads.c
 delete mode 100644 sysdeps/arm/nptl/unwind-forcedunwind.c
 create mode 100644 sysdeps/generic/libc_start_call_main.h
 rename sysdeps/{unix/sysv/linux/ia64/unwind-forcedunwind.c => ia64/unwind-resume.c} (87%)
 create mode 100644 sysdeps/nptl/libc_start_call_main.h
 delete mode 100644 sysdeps/nptl/unwind-forcedunwind.c
 delete mode 100644 sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c
 create mode 100644 sysdeps/unix/sysv/linux/s390/libpthread-compat.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/pt-longjmp.c
 delete mode 100644 sysdeps/x86/nptl/pt-longjmp.c

-- 
2.29.2