|
| 1 | +From: Christian Breunig <christian@breunig.cc> |
| 2 | +Date: Sat, 18 Jul 2026 18:30:00 +0000 |
| 3 | +Subject: [PATCH] arm64: fix relative syscalltbl path in Makefile.syscalls |
| 4 | + |
| 5 | +Building the "linux-perf" Debian package (added by |
| 6 | +0002-build-linux-perf-package.patch, via install_perf() invoking |
| 7 | +"make -C tools/perf ... install") reproducibly fails on an arm64 build |
| 8 | +host with: |
| 9 | + |
| 10 | + make[9]: *** No rule to make target |
| 11 | + '.../tools/perf/libperf/arch/arm64/include/generated/uapi/asm/unistd_64.h'. |
| 12 | + Stop. |
| 13 | + |
| 14 | +Root cause: tools/lib/perf/Makefile's "uapi-asm-generic:" recipe invokes |
| 15 | +scripts/Makefile.asm-headers without "-C $(srctree)", so it inherits |
| 16 | +whatever working directory tools/lib/perf/Makefile itself was invoked |
| 17 | +with - which is tools/lib/perf/, not the kernel source root. This is |
| 18 | +harmless for the generic default: |
| 19 | + |
| 20 | + syscalltbl := $(srctree)/scripts/syscall.tbl |
| 21 | + |
| 22 | +...which is absolute and thus resolves correctly regardless of the |
| 23 | +working directory. arch/arm64/kernel/Makefile.syscalls, however, |
| 24 | +overrides this with a relative path: |
| 25 | + |
| 26 | + syscalltbl = arch/arm64/tools/syscall_%.tbl |
| 27 | + |
| 28 | +When SRCARCH=arm64 (true both for the target kernel and, on a native |
| 29 | +arm64 build host, for tools/perf's own build), this relative path is |
| 30 | +looked up relative to tools/lib/perf/ instead of the kernel root, does |
| 31 | +not exist there, and the "unistd_%.h" pattern rule that depends on it |
| 32 | +can no longer be matched - so make reports no rule for the target at |
| 33 | +all, rather than a missing-prerequisite error. |
| 34 | + |
| 35 | +This only surfaces on a native arm64 build host: on x86_64 hosts (the |
| 36 | +common case for cross-building arm64 kernels) tools/perf builds for the |
| 37 | +x86_64 host architecture, which has no such override and always uses |
| 38 | +the safe, absolute default path. |
| 39 | + |
| 40 | +Fix by making arm64's override absolute too, matching the default and |
| 41 | +every other reference in this file's callers. |
| 42 | +--- |
| 43 | + arch/arm64/kernel/Makefile.syscalls | 2 +- |
| 44 | + 1 file changed, 1 insertion(+), 1 deletion(-) |
| 45 | + |
| 46 | +diff --git a/arch/arm64/kernel/Makefile.syscalls b/arch/arm64/kernel/Makefile.syscalls |
| 47 | +index 0542a718871a..958f2335ec1b 100644 |
| 48 | +--- a/arch/arm64/kernel/Makefile.syscalls |
| 49 | ++++ b/arch/arm64/kernel/Makefile.syscalls |
| 50 | +@@ -3,4 +3,4 @@ |
| 51 | + syscall_abis_32 += |
| 52 | + syscall_abis_64 += renameat rlimit memfd_secret |
| 53 | + |
| 54 | +-syscalltbl = arch/arm64/tools/syscall_%.tbl |
| 55 | ++syscalltbl = $(srctree)/arch/arm64/tools/syscall_%.tbl |
| 56 | +-- |
| 57 | +2.39.5 |
0 commit comments