Re: [PATCH] kbuild: fix spurious error from find when generating asm-headers

From: Randy Dunlap

Date: Sun Sep 13 2026 - 18:39:53 EST


Hi,

On 9/13/26 1:07 PM, H. Nikolaus Schaller wrote:
> The *.h pattern should be quoted or we may see errors like
>
> find: paths must precede expression: elf.h
> Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
>
> if the working directory contains some *.h files.
>
> This was found in a cross-compilation environment.
>
> Fixes: 2d69b891e6461 ("kbuild: Support generated asm-headers in subdirectories")
> Signed-off-by: H. Nikolaus Schaller <hns@xxxxxxxxxxxxx>
> ---
> 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 b38931314ad7c..9db8ab0145a44 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>"

Same as this other patch from 13 hours earlier:

https://lore.kernel.org/linux-kbuild/f54cae8e7da612ad558154706ce2e99f98d136c4.1789282037.git.tanggeliang@xxxxxxxxxx/T/#u

--
~Randy