[0/5] Implement built-in system call tables

Message ID cover.1576588849.git.fweimer@redhat.com
Headers show
Series
  • Implement built-in system call tables
Related show

Message

Florian Weimer Dec. 17, 2019, 2:30 p.m.
This series adds built-in system call tables.  The core build changes
are unchanged from the last submission:

  <https://sourceware.org/ml/libc-alpha/2019-05/msg00630.html>
  <https://sourceware.org/ml/libc-alpha/2019-05/msg00629.html>

Some adjustments were needed on alpha because it recently added the
standard syscall names (getpid etc.) to the UAPI headers, in addition to
the osf_* and getx* names.

The build-many-glibcs.py changes are new.  I tried to implement what
Joseph suggested to update the tables.  If you start with the usual
setup:

  checkout
  host-libraries
  compilers
  (possibly followed by glibcs)

and then run

  checkout linux-5.5 --replace-sources
  update-syscalls

you should get a patched glibc tree with the syscall additions from
Linux 5.5 (after it has been released).

The update-syscalls command uses the existing tools from the compilers
stage, but it creates a new Linux header installation on the side, and
uses that to run “make update-syscall-lists”.  This makes the command
reasonably quick.  After that, you can capture the diff and run a full
compilers/glibcs cycle if you want.

I still view this as required for reproducibility of the glibc system
call profile due to the Y2038 changes.

The installed shared objects are bit-wise identical after this change.
(There is some problem with stripping the .a libraries, so that part I
could not verify.)

I tried to build a bunch of architectures with the Linux 3.10 headers,
and this showed that hppa removed a bunch of _NR_HPUX_* defines from its
UAPI headers since then.  I have not patched the tables to include those
historic system call numbers, but I can do so if necessary.

Thanks,
Florian

Florian Weimer (5):
  Linux: Add tables with system call numbers
  Linux: Use system call tables during build
  build-many-glibcs.py: Introduce LinuxHeadersPolicyForBuild
  build-many-glibcs.py: Introduce glibc build policy classes
  build-many-glibcs.py: Implement update-syscalls command

 NEWS                                          |   3 +-
 scripts/build-many-glibcs.py                  | 285 +++++++----
 sysdeps/ia64/start.S                          |   1 -
 sysdeps/microblaze/backtrace_linux.c          |   2 +-
 sysdeps/unix/sysv/linux/Makefile              |  73 ++-
 .../unix/sysv/linux/aarch64/arch-syscall.h    | 290 +++++++++++
 sysdeps/unix/sysv/linux/alpha/arch-syscall.h  | 468 ++++++++++++++++++
 .../unix/sysv/linux/alpha/kernel-features.h   |   5 -
 sysdeps/unix/sysv/linux/alpha/sysdep.h        |  25 -
 sysdeps/unix/sysv/linux/arm/arch-syscall.h    | 392 +++++++++++++++
 sysdeps/unix/sysv/linux/arm/dl-machine.h      |   2 +-
 .../unix/sysv/linux/arm/fixup-asm-unistd.h    |  24 +
 sysdeps/unix/sysv/linux/arm/sysdep.h          |   4 -
 sysdeps/unix/sysv/linux/arm/tls.h             |   2 +-
 sysdeps/unix/sysv/linux/csky/arch-syscall.h   | 309 ++++++++++++
 sysdeps/unix/sysv/linux/fixup-asm-unistd.h    |  28 ++
 sysdeps/unix/sysv/linux/glibcsyscalls.py      | 165 ++++++
 sysdeps/unix/sysv/linux/hppa/arch-syscall.h   | 371 ++++++++++++++
 sysdeps/unix/sysv/linux/hppa/clone.S          |   1 -
 sysdeps/unix/sysv/linux/i386/arch-syscall.h   | 425 ++++++++++++++++
 sysdeps/unix/sysv/linux/ia64/arch-syscall.h   | 340 +++++++++++++
 sysdeps/unix/sysv/linux/ia64/brk.S            |   1 -
 sysdeps/unix/sysv/linux/ia64/clone2.S         |   4 +-
 sysdeps/unix/sysv/linux/ia64/syscall.S        |   2 +-
 sysdeps/unix/sysv/linux/ia64/sysdep.S         |   2 +-
 sysdeps/unix/sysv/linux/ia64/sysdep.h         |   5 +-
 sysdeps/unix/sysv/linux/include/sys/syscall.h |  29 ++
 sysdeps/unix/sysv/linux/m68k/arch-syscall.h   | 407 +++++++++++++++
 .../unix/sysv/linux/microblaze/arch-syscall.h | 429 ++++++++++++++++
 .../sysv/linux/mips/mips32/arch-syscall.h     | 402 +++++++++++++++
 .../sysv/linux/mips/mips64/n32/arch-syscall.h | 362 ++++++++++++++
 .../sysv/linux/mips/mips64/n64/arch-syscall.h | 338 +++++++++++++
 sysdeps/unix/sysv/linux/mips/vfork.S          |   1 -
 sysdeps/unix/sysv/linux/nios2/arch-syscall.h  | 311 ++++++++++++
 sysdeps/unix/sysv/linux/nios2/sysdep.h        |   1 -
 .../linux/powerpc/powerpc32/arch-syscall.h    | 417 ++++++++++++++++
 .../linux/powerpc/powerpc64/arch-syscall.h    | 389 +++++++++++++++
 sysdeps/unix/sysv/linux/riscv/flush-icache.c  |   1 +
 .../unix/sysv/linux/riscv/rv64/arch-syscall.h | 291 +++++++++++
 .../sysv/linux/s390/s390-32/arch-syscall.h    | 406 +++++++++++++++
 .../sysv/linux/s390/s390-64/arch-syscall.h    | 354 +++++++++++++
 sysdeps/unix/sysv/linux/sh/arch-syscall.h     | 400 +++++++++++++++
 .../sysv/linux/sparc/sparc32/arch-syscall.h   | 405 +++++++++++++++
 sysdeps/unix/sysv/linux/sparc/sparc32/clone.S |   1 -
 .../sysv/linux/sparc/sparc64/arch-syscall.h   | 368 ++++++++++++++
 sysdeps/unix/sysv/linux/sparc/sparc64/clone.S |   1 -
 sysdeps/unix/sysv/linux/sys/syscall.h         |  11 +-
 sysdeps/unix/sysv/linux/tst-glibcsyscalls.py  |  88 ++++
 sysdeps/unix/sysv/linux/tst-mman-consts.py    |  12 +-
 .../unix/sysv/linux/update-syscall-lists.py   |  66 +++
 .../unix/sysv/linux/x86_64/64/arch-syscall.h  | 347 +++++++++++++
 .../unix/sysv/linux/x86_64/x32/arch-syscall.h | 336 +++++++++++++
 52 files changed, 9227 insertions(+), 175 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/alpha/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/arm/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/arm/fixup-asm-unistd.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/fixup-asm-unistd.h
 create mode 100644 sysdeps/unix/sysv/linux/glibcsyscalls.py
 create mode 100644 sysdeps/unix/sysv/linux/hppa/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/i386/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/ia64/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/include/sys/syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/m68k/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/microblaze/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/nios2/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/sh/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/tst-glibcsyscalls.py
 create mode 100644 sysdeps/unix/sysv/linux/update-syscall-lists.py
 create mode 100644 sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h
 create mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h

-- 
2.23.0

Comments

Florian Weimer Jan. 1, 2020, 10:35 a.m. | #1
I have rebased the series after the year 2020 change.  It's on branch
fw/builtin-syscalls-5.  No other changes.  (I did not use sed; there
is a system call number that contains “2019”.)