linux/tools/arch
Leo Yan 096b86ce08 tools headers: Go back to include asm-generic/unistd.h for arm64
The header unistd.h is included under Arm64's uAPI folder (see
tools/arch/arm64/include/uapi/asm/), but it does not include its
dependent header unistd_64.h.

The intention is for unistd_64.h to be generated dynamically using
scripts/Makefile.asm-headers.

However, this dynamic approach causes problems because the header is not
available early enough, even though it is widely included throughout
tools.

Using the perf build as an example:

 1) Feature detection: Perf first runs feature tests.

    The BPF feature program test-bpf.c includes unistd.h.  Since
    unistd_64.h has not been generated yet, the program fails to build,
    and the BPF feature ends up being disabled.

 2) libperf build:

    The libperf Makefile later generates unistd_64.h on the fly, so
    libperf itself builds successfully.

 3) Final perf build:

    Although the perf binary can build successfully using the generated
    header, we never get a chance to build BPF skeleton programs,
    because BPF support was already disabled earlier.

Restore to include asm-generic/unistd.h for fixing the issue.  This
aligns with most architectures (x86 is a special case that keeps
unistd_32.h/unistd_64.h for its particular syscall numbers) and ensures
the header is available from the start.

Fixes: 22f72088ff ("tools headers: Update the syscall table with the kernel sources")
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Leo Yan <leo.yan@arm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2026-01-26 17:06:32 -03:00
..
alpha/include tools headers uapi: Sync asm-generic/mman-common.h and linux/mman.h 2019-03-28 14:31:56 -03:00
arc/include/uapi/asm tools arch uapi: Copy missing unistd.h headers for arc, hexagon and riscv 2019-05-02 16:00:20 -04:00
arm/include tools headers: Remove unused arm32 asm/kvm.h copy 2025-09-11 16:58:21 -03:00
arm64 tools headers: Go back to include asm-generic/unistd.h for arm64 2026-01-26 17:06:32 -03:00
csky/include/uapi/asm csky: Add support for libdw 2019-05-15 16:36:46 -03:00
hexagon/include/uapi/asm tools arch: Remove uapi bitsperlong.h of hexagon and microblaze 2023-06-22 17:04:37 +02:00
loongarch/include objtool/LoongArch: Mark special atomic instruction as INSN_BUG type 2025-09-18 19:43:36 +08:00
microblaze/include/uapi/asm tools arch: Remove uapi bitsperlong.h of hexagon and microblaze 2023-06-22 17:04:37 +02:00
mips/include perf tools: Copy uapi/asm/perf_regs.h from the kernel for MIPS 2021-06-01 10:07:46 -03:00
parisc/include/uapi/asm parisc: Drop the HP-UX ENOSYM and EREMOTERELEASE error codes 2023-11-25 09:43:18 +01:00
powerpc/include tools headers: Sync powerpc headers with the kernel source 2025-08-18 13:49:25 -07:00
riscv/include tools: riscv: Fixed misalignment of CSR related definitions 2025-11-16 10:37:38 -07:00
s390/include tools: Remove s390 compat support 2025-11-17 11:10:38 +01:00
sh/include sh: remove sh5 support 2020-06-01 14:48:52 -04:00
sparc/include tools headers UAPI: Update tools's copy of mman.h headers 2019-07-29 09:02:58 -03:00
x86 tools headers: Sync x86 headers with kernel sources 2025-12-24 11:43:04 -08:00
xtensa/include tools headers uapi: Sync asm-generic/mman-common.h and linux/mman.h 2019-03-28 14:31:56 -03:00