[00/30] libpthread removal: pthread-compat-wrappers and other libc symbols

Message ID 20210316200510.2135405-1-adhemerval.zanella@linaro.org
Headers
Series libpthread removal: pthread-compat-wrappers and other libc symbols |

Message

Adhemerval Zanella Netto March 16, 2021, 8:04 p.m. UTC
  This set removes all the pthread-compat-wrappers symbols from
libpthread plus some others that are already presented on libc
(the pthread_kill was done to enable the raise removal).

It has been tested on i686-linux-gnu and x86_64-linux-gnu, and
built by build-many-glibcs.py for all ABIs that required abilist
changes.

Adhemerval Zanella (30):
  nptl: Remove write from libpthread
  nptl: Remove read from libpthread
  nptl: Remove close from libpthread
  nptl: Remove accept from libpthread
  nptl: Remove connect from libpthread
  nptl: Remove recv from libpthread
  nptl: Remove recvfrom from libpthread
  nptl: Remove send from libpthread
  nptl: Remove sendto from libpthread
  nptl: Remove fsync from libpthread
  nptl: Remove lseek from libpthread
  nptl: Remove msync from libpthread
  nptl: Remove open from libpthread
  nptl: Remove pause from libpthread
  nptl: Remove pread from libpthread
  nptl: Remove pwrite from libpthread
  nptl: Remove tcdrain from libpthread
  nptl: Remove msgrcv from libpthread
  nptl: Remove msgsnd from libpthread
  nptl: Remove sigwait from libpthread
  nptl: Remove sigsuspend from libpthread
  nptl: Remove recvmsg from libpthread
  nptl: Remove sendmsg from libpthread
  nptl: Move fcntl from libpthread
  nptl: Move pthread_kill to libc
  nptl: Remove pthread raise implementation
  nptl: Move system to libc
  signal: Add __libc_sigaction
  nptl: Move sigaction to libc
  nptl: Remove __libc_allocate_rtsig, __libc_current_sigrtmax, and
    __libc_current_sigrtmin

 include/unistd.h                              |  7 ++-
 io/Makefile                                   |  7 ++-
 nptl/Makefile                                 | 49 +-----------------
 nptl/Versions                                 | 51 ++-----------------
 nptl/pt-allocrtsig.c                          | 50 ------------------
 nptl/pt-system.c                              | 45 ----------------
 nptl/pthread_kill.c                           |  9 +++-
 nptl/version.c                                |  2 +-
 signal/Makefile                               |  2 +-
 signal/Versions                               |  3 ++
 signal/allocrtsig.c                           |  6 +--
 nptl/pt-raise.c => signal/libc_sigaction.c    | 19 ++++---
 signal/sigaction.c                            |  7 +--
 socket/Makefile                               |  7 +++
 sysdeps/generic/internal-signals.h            |  4 ++
 .../hurd/{sigaction.c => libc_sigaction.c}    | 12 ++---
 sysdeps/pthread/sem_open.c                    | 10 ++--
 sysdeps/unix/pt-fcntl.c                       | 49 ------------------
 sysdeps/unix/syscalls.list                    |  1 -
 sysdeps/unix/sysv/linux/aarch64/Versions      |  3 ++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist  |  3 ++
 .../aarch64/{sigaction.c => libc_sigaction.c} |  2 +-
 .../sysv/linux/aarch64/libpthread.abilist     | 44 ----------------
 sysdeps/unix/sysv/linux/alpha/libc.abilist    | 10 ++++
 .../unix/sysv/linux/alpha/libpthread.abilist  | 44 ----------------
 .../unix/sysv/linux/alpha/pread64.c           | 30 +++++------
 .../sysv/linux/alpha/pwrite64.c}              | 25 ++++-----
 sysdeps/unix/sysv/linux/arc/libc.abilist      |  2 +
 .../arc/{sigaction.c => libc_sigaction.c}     |  2 +-
 .../unix/sysv/linux/arc/libpthread.abilist    | 41 ---------------
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  2 +
 .../unix/sysv/linux/arm/be/libpthread.abilist | 44 ----------------
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  2 +
 .../unix/sysv/linux/arm/le/libpthread.abilist | 44 ----------------
 .../arm/{sigaction.c => libc_sigaction.c}     |  2 +-
 sysdeps/unix/sysv/linux/csky/libc.abilist     |  2 +
 .../unix/sysv/linux/csky/libpthread.abilist   | 41 ---------------
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |  2 +
 .../unix/sysv/linux/hppa/libpthread.abilist   | 44 ----------------
 sysdeps/unix/sysv/linux/i386/libc.abilist     | 10 ++++
 .../i386/{sigaction.c => libc_sigaction.c}    |  2 +-
 .../unix/sysv/linux/i386/libpthread.abilist   | 44 ----------------
 sysdeps/unix/sysv/linux/ia64/libc.abilist     |  2 +
 .../unix/sysv/linux/ia64/libpthread.abilist   | 44 ----------------
 sysdeps/unix/sysv/linux/internal-signals.h    |  5 ++
 .../linux/{sigaction.c => libc_sigaction.c}   |  2 -
 sysdeps/unix/sysv/linux/lseek64.c             | 10 +++-
 .../sysv/linux/m68k/coldfire/libc.abilist     |  2 +
 .../linux/m68k/coldfire/libpthread.abilist    | 44 ----------------
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  | 10 ++++
 .../sysv/linux/m68k/m680x0/libpthread.abilist | 44 ----------------
 .../sysv/linux/microblaze/be/libc.abilist     |  2 +
 .../linux/microblaze/be/libpthread.abilist    | 44 ----------------
 .../sysv/linux/microblaze/le/libc.abilist     |  2 +
 .../linux/microblaze/le/libpthread.abilist    | 44 ----------------
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |  2 +
 .../sysv/linux/mips/mips32/libpthread.abilist | 44 ----------------
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  2 +
 .../sysv/linux/mips/mips64/libpthread.abilist | 44 ----------------
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  2 +
 .../sysv/linux/mips/mips64/n64/libc.abilist   |  2 +
 sysdeps/unix/sysv/linux/nios2/Versions        |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |  3 ++
 .../unix/sysv/linux/nios2/libpthread.abilist  | 44 ----------------
 sysdeps/unix/sysv/linux/open64.c              | 11 +++-
 .../linux/powerpc/powerpc32/fpu/libc.abilist  | 10 ++++
 .../powerpc/powerpc32/libpthread.abilist      | 44 ----------------
 .../powerpc/powerpc32/nofpu/libc.abilist      | 10 ++++
 .../linux/powerpc/powerpc64/be/libc.abilist   |  2 +
 .../powerpc/powerpc64/be/libpthread.abilist   | 44 ----------------
 .../linux/powerpc/powerpc64/le/libc.abilist   |  2 +
 .../powerpc/powerpc64/le/libpthread.abilist   | 44 ----------------
 sysdeps/unix/sysv/linux/pread.c               | 13 +++++
 sysdeps/unix/sysv/linux/pread64.c             | 28 ++++++++--
 sysdeps/unix/sysv/linux/pt-raise.c            | 20 --------
 sysdeps/unix/sysv/linux/pwrite.c              | 13 +++++
 sysdeps/unix/sysv/linux/pwrite64.c            | 29 +++++++++--
 .../unix/sysv/linux/riscv/rv32/libc.abilist   |  2 +
 .../sysv/linux/riscv/rv32/libpthread.abilist  | 41 ---------------
 .../unix/sysv/linux/riscv/rv64/libc.abilist   |  2 +
 .../sysv/linux/riscv/rv64/libpthread.abilist  | 43 ----------------
 .../unix/sysv/linux/s390/s390-32/libc.abilist | 10 ++++
 .../linux/s390/s390-32/libpthread.abilist     | 44 ----------------
 .../unix/sysv/linux/s390/s390-64/libc.abilist |  2 +
 .../linux/s390/s390-64/libpthread.abilist     | 44 ----------------
 sysdeps/unix/sysv/linux/send.c                |  2 -
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  2 +
 .../unix/sysv/linux/sh/be/libpthread.abilist  | 44 ----------------
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  2 +
 .../unix/sysv/linux/sh/le/libpthread.abilist  | 44 ----------------
 .../sysv/linux/sparc/sparc32/libc.abilist     | 10 ++++
 .../sparc32/{sigaction.c => libc_sigaction.c} |  2 +-
 .../linux/sparc/sparc32/libpthread.abilist    | 44 ----------------
 .../sysv/linux/sparc/sparc64/libc.abilist     |  2 +
 .../sparc64/{sigaction.c => libc_sigaction.c} |  2 +-
 .../linux/sparc/sparc64/libpthread.abilist    | 44 ----------------
 sysdeps/unix/sysv/linux/sysdep.h              |  4 --
 .../unix/sysv/linux/x86_64/64/libc.abilist    |  2 +
 .../sysv/linux/x86_64/64/libpthread.abilist   | 44 ----------------
 .../x86_64/{sigaction.c => libc_sigaction.c}  |  2 +-
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |  2 +
 .../sysv/linux/x86_64/x32/libpthread.abilist  | 44 ----------------
 102 files changed, 320 insertions(+), 1618 deletions(-)
 delete mode 100644 nptl/pt-allocrtsig.c
 delete mode 100644 nptl/pt-system.c
 rename nptl/pt-raise.c => signal/libc_sigaction.c (64%)
 rename sysdeps/mach/hurd/{sigaction.c => libc_sigaction.c} (89%)
 delete mode 100644 sysdeps/unix/pt-fcntl.c
 rename sysdeps/unix/sysv/linux/aarch64/{sigaction.c => libc_sigaction.c} (95%)
 rename nptl/sigaction.c => sysdeps/unix/sysv/linux/alpha/pread64.c (52%)
 rename sysdeps/{nptl/allocrtsig.c => unix/sysv/linux/alpha/pwrite64.c} (53%)
 rename sysdeps/unix/sysv/linux/arc/{sigaction.c => libc_sigaction.c} (95%)
 rename sysdeps/unix/sysv/linux/arm/{sigaction.c => libc_sigaction.c} (96%)
 rename sysdeps/unix/sysv/linux/i386/{sigaction.c => libc_sigaction.c} (97%)
 rename sysdeps/unix/sysv/linux/{sigaction.c => libc_sigaction.c} (98%)
 delete mode 100644 sysdeps/unix/sysv/linux/pt-raise.c
 rename sysdeps/unix/sysv/linux/sparc/sparc32/{sigaction.c => libc_sigaction.c} (96%)
 rename sysdeps/unix/sysv/linux/sparc/sparc64/{sigaction.c => libc_sigaction.c} (95%)
 rename sysdeps/unix/sysv/linux/x86_64/{sigaction.c => libc_sigaction.c} (99%)
  

Comments

Florian Weimer March 17, 2021, 2:22 p.m. UTC | #1
* Adhemerval Zanella via Libc-alpha:

> This set removes all the pthread-compat-wrappers symbols from
> libpthread plus some others that are already presented on libc
> (the pthread_kill was done to enable the raise removal).
>
> It has been tested on i686-linux-gnu and x86_64-linux-gnu, and
> built by build-many-glibcs.py for all ABIs that required abilist
> changes.

I see a check-localplt failure on arm-linux-gnueabi (and the other arm*
targets):

Missing required PLT reference: libpthread.so: raise                           

Sorry, I haven't pinpointed it to a specific commit yet, but I suspect
it's towards the end.

Thanks,
Florian
  
Adhemerval Zanella Netto March 17, 2021, 2:25 p.m. UTC | #2
On 17/03/2021 11:22, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> This set removes all the pthread-compat-wrappers symbols from
>> libpthread plus some others that are already presented on libc
>> (the pthread_kill was done to enable the raise removal).
>>
>> It has been tested on i686-linux-gnu and x86_64-linux-gnu, and
>> built by build-many-glibcs.py for all ABIs that required abilist
>> changes.
> 
> I see a check-localplt failure on arm-linux-gnueabi (and the other arm*
> targets):
> 
> Missing required PLT reference: libpthread.so: raise                           
> 
> Sorry, I haven't pinpointed it to a specific commit yet, but I suspect
> it's towards the end.
> 

I adding the default symbol version changes you asked and I will resend
it after a run a full make check on the affected ABIs.
  
Florian Weimer March 17, 2021, 8:35 p.m. UTC | #3
I've posted my comments and updated Patchwork.  I'm not sure if it's
valuable to acknowledge the patches on the list for which I don't think
changes are needed.

Thanks,
Florian