[PATCH v2 3/3] checksyscalls: move instance functionality into generic code

Thomas Weißschuh posted 3 patches 1 week, 2 days ago
There is a newer version of this series
[PATCH v2 3/3] checksyscalls: move instance functionality into generic code
Posted by Thomas Weißschuh 1 week, 2 days ago
On MIPS the checksyscalls.sh script may be executed multiple times.
Currently these multiple executions are executed on each build as kbuild
see that the commands have changed each time.

Use a dedicated stamp file for each different invocation to avoid the
spurious executions.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 Kbuild             | 4 ++--
 arch/mips/Makefile | 6 ++----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/Kbuild b/Kbuild
index 515cc6a27477..fb547bc5ff41 100644
--- a/Kbuild
+++ b/Kbuild
@@ -47,11 +47,11 @@ $(rq-offsets-file): kernel/sched/rq-offsets.s FORCE
 
 # Check for missing system calls
 
-missing-syscalls-file := .tmp_missing-syscalls
+missing-syscalls-file := .tmp_missing-syscalls$(missing_syscalls_instance)
 
 targets += $(missing-syscalls-file)
 
-quiet_cmd_syscalls = CALL    $<
+quiet_cmd_syscalls = CALL    $< $(if $(missing_syscalls_instance),for $(missing_syscalls_instance))
       cmd_syscalls = DEPFILE=$(depfile) $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags); touch $@
 
 $(missing-syscalls-file): scripts/checksyscalls.sh $(rq-offsets-file) FORCE
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index d9057e29bc62..6705fa5d9211 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -421,12 +421,10 @@ CLEAN_FILES += vmlinux.32 vmlinux.64
 
 archprepare:
 ifdef CONFIG_MIPS32_N32
-	@$(kecho) '  Checking missing-syscalls for N32'
-	$(Q)$(MAKE) $(build)=. missing-syscalls missing_syscalls_flags="-mabi=n32"
+	$(Q)$(MAKE) $(build)=. missing-syscalls missing_syscalls_instance="N32" missing_syscalls_flags="-mabi=n32"
 endif
 ifdef CONFIG_MIPS32_O32
-	@$(kecho) '  Checking missing-syscalls for O32'
-	$(Q)$(MAKE) $(build)=. missing-syscalls missing_syscalls_flags="-mabi=32"
+	$(Q)$(MAKE) $(build)=. missing-syscalls missing_syscalls_instance="O32" missing_syscalls_flags="-mabi=32"
 endif
 
 install:

-- 
2.53.0

Re: [PATCH v2 3/3] checksyscalls: move instance functionality into generic code
Posted by Nicolas Schier 20 hours ago
On Tue, 24 Mar 2026 18:16:47 +0100, Thomas Weißschuh <linux@weissschuh.net> wrote:
> diff --git a/Kbuild b/Kbuild
> index 515cc6a27477..fb547bc5ff41 100644
> --- a/Kbuild
> +++ b/Kbuild
> @@ -47,11 +47,11 @@ $(rq-offsets-file): kernel/sched/rq-offsets.s FORCE
>  
>  # Check for missing system calls
>  
> -missing-syscalls-file := .tmp_missing-syscalls
> +missing-syscalls-file := .tmp_missing-syscalls$(missing_syscalls_instance)
>  
>  targets += $(missing-syscalls-file)
>  
> -quiet_cmd_syscalls = CALL    $<
> +quiet_cmd_syscalls = CALL    $< $(if $(missing_syscalls_instance),for $(missing_syscalls_instance))

Nice solution!

$(addprefix) shortens a bit here:

quiet_cmd_syscalls = CALL    $< $(addprefix for ,$(missing_syscalls_instance))

-- 
Nicolas