From: Masahiro Yamada Date: Wed, 17 Jul 2024 16:24:20 +0000 (+0900) Subject: kbuild: fix rebuild of generic syscall headers X-Git-Tag: v6.11-rc1~140 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=49208b67585d18521225bf72bf842593cea711f8;p=thirdparty%2Fkernel%2Flinux.git kbuild: fix rebuild of generic syscall headers Commit fbb5c0606fa4 ("kbuild: add syscall table generation to scripts/Makefile.asm-headers") started to generate syscall headers for architectures using generic syscalls. However, these headers are always rebuilt using GNU Make 4.4.1 or newer. When using GNU Make 4.4 or older, these headers are not rebuilt when the command to generate them is changed, despite the use of the if_changed macro. scripts/Makefile.asm-headers now uses FORCE, but it is not marked as .PHONY. To handle the command line change correctly, .*.cmd files must be included. Fixes: fbb5c0606fa4 ("kbuild: add syscall table generation to scripts/Makefile.asm-headers") Reported-by: Linus Torvalds Closes: https://lore.kernel.org/lkml/CAHk-=wibB7SvXnUftBgAt+4-3vEKRpvEgBeDEH=i=j2GvDitoA@mail.gmail.com/ Signed-off-by: Masahiro Yamada Tested-by: Arnd Bergmann Signed-off-by: Linus Torvalds --- diff --git a/scripts/Makefile.asm-headers b/scripts/Makefile.asm-headers index 6b8e8318e810d..8a4856e741803 100644 --- a/scripts/Makefile.asm-headers +++ b/scripts/Makefile.asm-headers @@ -87,12 +87,20 @@ $(obj)/unistd_compat_%.h: $(syscalltbl) $(syshdr) FORCE $(obj)/syscall_table_%.h: $(syscalltbl) $(systbl) FORCE $(call if_changed,systbl) +targets := $(syscall-y) + # Create output directory. Skip it if at least one old header exists # since we know the output directory already exists. ifeq ($(old-headers),) $(shell mkdir -p $(obj)) endif +PHONY += FORCE + FORCE: +existing-targets := $(wildcard $(sort $(targets))) + +-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) + .PHONY: $(PHONY)