All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Schier <nsc@kernel.org>
To: Geliang Tang <geliang@kernel.org>
Cc: "Nathan Chancellor" <nathan@kernel.org>,
	"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Thomas Gleixner" <tglx@kernel.org>,
	"Geliang Tang" <tanggeliang@kylinos.cn>,
	linux-kbuild@vger.kernel.org
Subject: Re: [PATCH] kbuild: quote glob pattern in find command for asm-headers
Date: Mon, 14 Sep 2026 09:08:07 +0200	[thread overview]
Message-ID: <aqedV_5DtnT1sRAN@levanger> (raw)
In-Reply-To: <f54cae8e7da612ad558154706ce2e99f98d136c4.1789282037.git.tanggeliang@kylinos.cn>

On Sun, Sep 13, 2026 at 02:49:14PM +0800, Geliang Tang wrote:
> 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
> 

Thanks.  This is fixed by [1], released in v7.3-rc3 a few hours after
your mail.

Kind regards,
Nicolas

[1]: https://git.kernel.org/kbuild/c/06bb43d8c79762fa3452f292cd080e54bef5d431

-- 
Nicolas

      reply	other threads:[~2026-09-14  7:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aqedV_5DtnT1sRAN@levanger \
    --to=nsc@kernel.org \
    --cc=geliang@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=tanggeliang@kylinos.cn \
    --cc=tglx@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.