Skip to content

Commit 49208b6

Browse files
masahir0ytorvalds
authored andcommitted
kbuild: fix rebuild of generic syscall headers
Commit fbb5c06 ("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: fbb5c06 ("kbuild: add syscall table generation to scripts/Makefile.asm-headers") Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Closes: https://lore.kernel.org/lkml/CAHk-=wibB7SvXnUftBgAt+4-3vEKRpvEgBeDEH=i=j2GvDitoA@mail.gmail.com/ Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Tested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent b3ce7a3 commit 49208b6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/Makefile.asm-headers

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,20 @@ $(obj)/unistd_compat_%.h: $(syscalltbl) $(syshdr) FORCE
8787
$(obj)/syscall_table_%.h: $(syscalltbl) $(systbl) FORCE
8888
$(call if_changed,systbl)
8989

90+
targets := $(syscall-y)
91+
9092
# Create output directory. Skip it if at least one old header exists
9193
# since we know the output directory already exists.
9294
ifeq ($(old-headers),)
9395
$(shell mkdir -p $(obj))
9496
endif
9597

98+
PHONY += FORCE
99+
96100
FORCE:
97101

102+
existing-targets := $(wildcard $(sort $(targets)))
103+
104+
-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
105+
98106
.PHONY: $(PHONY)

0 commit comments

Comments
 (0)