All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: quote glob pattern in find command for asm-headers
@ 2026-09-13  6:49 Geliang Tang
  2026-09-14  7:08 ` Nicolas Schier
  0 siblings, 1 reply; 2+ messages in thread
From: Geliang Tang @ 2026-09-13  6:49 UTC (permalink / raw)
  To: Nathan Chancellor, Nicolas Schier, Thomas Weißschuh,
	Thomas Gleixner
  Cc: Geliang Tang, linux-kbuild

From: Geliang Tang <tanggeliang@kylinos.cn>

The find command in Makefile.asm-headers uses an unquoted *.h glob
pattern inside $(shell ...):

  old-headers := $(shell test -d $(obj) && find $(obj) -name *.h)

Since $(shell ...) runs in the build output directory, the shell
expands *.h against the current directory before passing arguments
to find. When the output directory contains .h files (e.g. stale
BPF skeleton headers), this produces:

  find: paths must precede expression: `xxx.skel.h'
  find: possible unquoted pattern after predicate `-name'?

Quote the glob pattern as '*.h' so that it is passed literally to
find, which will then expand it internally against $(obj).

Fixes: 2d69b891e646 ("kbuild: Support generated asm-headers in subdirectories")
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 scripts/Makefile.asm-headers | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.asm-headers b/scripts/Makefile.asm-headers
index b38931314ad7..9db8ab0145a4 100644
--- a/scripts/Makefile.asm-headers
+++ b/scripts/Makefile.asm-headers
@@ -48,7 +48,7 @@ syscall-y   := $(addprefix $(obj)/, $(syscall-y))
 generated-y := $(addprefix $(obj)/, $(generated-y))
 
 # Remove stale wrappers when the corresponding files are removed from generic-y
-old-headers := $(shell test -d $(obj) && find $(obj) -name *.h)
+old-headers := $(shell test -d $(obj) && find $(obj) -name '*.h')
 unwanted    := $(filter-out $(generic-y) $(generated-y) $(syscall-y),$(old-headers))
 
 filechk_wrap = echo "\#include <asm-generic/$*.h>"
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-14  7:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-13  6:49 [PATCH] kbuild: quote glob pattern in find command for asm-headers Geliang Tang
2026-09-14  7:08 ` Nicolas Schier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.