Simplify syscall generation and ABI source file handling for the build.
authorbdrewery <bdrewery@FreeBSD.org>
Tue, 13 Oct 2015 18:23:51 +0000 (18:23 +0000)
committerbdrewery <bdrewery@FreeBSD.org>
Tue, 13 Oct 2015 18:23:51 +0000 (18:23 +0000)
commit4512feb33fd6a89f2cfa84287fa4de5e5c3db4b6
treeeaafd2272e8622e2d62d7abfe92257e23f6e6860
parent384c892651c52e57063356328dfcd28914bc4b15
Simplify syscall generation and ABI source file handling for the build.

This is to make the Makefile more easily extendable for new ABIs.

This also makes several other subtle changes:
  -  The build now is given a list of ABIs to use based on the MACHINE_ARCH or
     MACHINE_CPUARCH.  These ABIs have a related path in sys/ that is used
     to generate their syscalls.  For each ABI to build check for a
     ABI.c, MACHINE_ARCH-ABI.c, or a MACHINE_CPUARCH-ABI.c.  This matches
     the old behavior needed for archs such as powerpc* and mips*.
  -  The ABI source file selection allows for simpler assignment of common
     ABIs such as "fbsd32" from sys/compat/freebsd32, or cloudabi64.
  - Expand 'fbsd' to 'freebsd' everywhere for consistency.
  -  Split out the powerpc-fbsd.c file into a powerpc64-freebsd32.c to be more
     like the amd64-freebsd32.c file and to more easily allow the auto-generation
     of ABI handling to work.
  -  Rename 'syscalls.h' to 'fbsd_syscalls.h' to lessen the ambiguity and
     avoid confusion with syscall.h (such as in r288997).
  -  For non-native syscall header files, they are now renamed to be
     ABI_syscalls.h, where ABI is what ABI the Makefile is building.
  -  Remove all of the makesyscalls config files.  The "native" one being
     name i386.conf was a long outstanding bug.  They were all the same
     except for the data they generated, so now it is just auto-generated
     as a build artifact.
  -  The syscalls array is now fixed to be static in the syscalls header to
     remove the compiler warning about non-extern.  This was worked around
     in the aarch64-fbsd.c file but not the others.
  -  All syscall table names are now just 'syscallnames' since they don't
     need to be different as they are all static in their own ABI files.  The
     alternative is to name them ABI_syscallnames which does not seem
     necessary.

Reviewed by: ed, jhb
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D3851
20 files changed:
usr.bin/truss/Makefile
usr.bin/truss/Makefile.depend.amd64
usr.bin/truss/aarch64-freebsd.c [moved from usr.bin/truss/aarch64-fbsd.c with 95% similarity]
usr.bin/truss/amd64-cloudabi64.c
usr.bin/truss/amd64-freebsd.c [moved from usr.bin/truss/amd64-fbsd.c with 97% similarity]
usr.bin/truss/amd64-freebsd32.c [moved from usr.bin/truss/amd64-fbsd32.c with 86% similarity]
usr.bin/truss/amd64-linux32.c
usr.bin/truss/amd64cloudabi64.conf [deleted file]
usr.bin/truss/amd64linux32.conf [deleted file]
usr.bin/truss/arm-freebsd.c [moved from usr.bin/truss/arm-fbsd.c with 97% similarity]
usr.bin/truss/fbsd32.conf [deleted file]
usr.bin/truss/i386-freebsd.c [moved from usr.bin/truss/i386-fbsd.c with 95% similarity]
usr.bin/truss/i386-linux.c
usr.bin/truss/i386linux.conf [deleted file]
usr.bin/truss/makesyscallsconf.sh [moved from usr.bin/truss/i386.conf with 66% similarity, mode: 0755]
usr.bin/truss/mips-freebsd.c [moved from usr.bin/truss/mips-fbsd.c with 97% similarity]
usr.bin/truss/powerpc-freebsd.c [copied from usr.bin/truss/powerpc-fbsd.c with 82% similarity]
usr.bin/truss/powerpc64-freebsd.c [moved from usr.bin/truss/powerpc64-fbsd.c with 97% similarity]
usr.bin/truss/powerpc64-freebsd32.c [moved from usr.bin/truss/powerpc-fbsd.c with 81% similarity]
usr.bin/truss/sparc64-freebsd.c [moved from usr.bin/truss/sparc64-fbsd.c with 97% similarity]