]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
checksyscalls: only run when necessary
authorThomas Weißschuh <linux@weissschuh.net>
Thu, 2 Apr 2026 14:36:19 +0000 (16:36 +0200)
committerNicolas Schier <nsc@kernel.org>
Sun, 5 Apr 2026 07:21:31 +0000 (09:21 +0200)
Currently checksyscalls.sh is unconditionally executed during each build.
Most of these executions are unnecessary.

Only run checksyscalls.sh if one of its inputs have changed.

This new logic does not work for the multiple invocations done for MIPS.
The effect is that checksyscalls.sh is still executed unconditionally.
However this is not worse than before.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Link: https://patch.msgid.link/20260402-kbuild-missing-syscalls-v3-2-6641be1de2db@weissschuh.net
Signed-off-by: Nicolas Schier <nsc@kernel.org>
Kbuild
scripts/checksyscalls.sh

diff --git a/Kbuild b/Kbuild
index 13324b4bbe236a50d388700fa6e8606258bc7c34..515cc6a27477fe44b34c5d2f5af3fe3a131a4a80 100644 (file)
--- a/Kbuild
+++ b/Kbuild
@@ -47,12 +47,18 @@ $(rq-offsets-file): kernel/sched/rq-offsets.s FORCE
 
 # Check for missing system calls
 
+missing-syscalls-file := .tmp_missing-syscalls
+
+targets += $(missing-syscalls-file)
+
 quiet_cmd_syscalls = CALL    $<
-      cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
+      cmd_syscalls = DEPFILE=$(depfile) $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags); touch $@
+
+$(missing-syscalls-file): scripts/checksyscalls.sh $(rq-offsets-file) FORCE
+       $(call if_changed_dep,syscalls)
 
 PHONY += missing-syscalls
-missing-syscalls: scripts/checksyscalls.sh $(rq-offsets-file)
-       $(call cmd,syscalls)
+missing-syscalls: $(missing-syscalls-file)
 
 # Check the manual modification of atomic headers
 
index b2ab3b1d76b849d48756b956791136130bad544a..e2970421c1ffff0790625f0894a27e24c7cada02 100755 (executable)
@@ -275,3 +275,8 @@ syscall_list() {
 
 (ignore_list && syscall_list ${reference_table}) | \
 $* -Wno-error -Wno-unused-macros -E -x c - > /dev/null
+
+# For fixdep
+if [ -n "${DEPFILE}" ]; then
+       echo "${0}: ${0} ${reference_table}" >> "${DEPFILE}"
+fi