[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK7LNARKnzM8hX1P1Gt8MDb6DxO4Nys7k9vphwqsrVW29vZg8g@mail.gmail.com>
Date: Sat, 8 Feb 2025 06:14:10 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Daniel Xu <dxu@...uu.xyz>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
bpf@...r.kernel.org, jolsa@...nel.org
Subject: Re: [PATCH] tools/build: Skip jobserver flgas in -s detection
On Sun, Feb 2, 2025 at 5:11 AM Daniel Xu <dxu@...uu.xyz> wrote:
>
> Currently there is unnecessarily verbose output:
>
> $ make -j8 bzImage
> mkdir -p /home/dlxu/dev/linux/tools/objtool && make
> O=/home/dlxu/dev/linux subdir=tools/objtool --no-print-directory -C
> objtool
> mkdir -p /home/dlxu/dev/linux/tools/bpf/resolve_btfids && make
> O=/home/dlxu/dev/linux subdir=tools/bpf/resolve_btfids
> --no-print-directory -C bpf/resolve_btfids
> INSTALL libsubcmd_headers
> INSTALL libsubcmd_headers
> UPD include/config/kernel.release
>
> The reason this happens is that it seems that make is internally adding
> the following flag to $(MAKEFLAGS):
>
> ---jobserver-auth=fifo:/tmp/GMfifo1880691
>
> This breaks -s detection which searches for 's' in $(short-opts), as any
> this entire long flag is treated as a short flag and the presence of any
> 's' triggers silent=1.
>
> Fix by filtering out such flags so it's still correct to do a substring
> search for 's'.
>
> Signed-off-by: Daniel Xu <dxu@...uu.xyz>
This is not the right fix.
The code for calculating short-opts is correct.
This is documented in GNU Make manual:
Recall that MAKEFLAGS will put all single-letter options (such as ‘-t’) into
the first word, and that word will be empty if no single-letter options were
given. To work with this, it’s helpful to add a value at the start to ensure
there’s a word: for example ‘-$(MAKEFLAGS)’.
https://www.gnu.org/software/make/manual/make.html#Testing-Flags
The root cause is different.
> ---
> tools/scripts/Makefile.include | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
> index 0aa4005017c7..a413f73a7856 100644
> --- a/tools/scripts/Makefile.include
> +++ b/tools/scripts/Makefile.include
> @@ -139,9 +139,9 @@ endif
> # If the user is running make -s (silent mode), suppress echoing of commands
> # make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS.
> ifeq ($(filter 3.%,$(MAKE_VERSION)),)
> -short-opts := $(firstword -$(MAKEFLAGS))
> +short-opts := $(filter-out ---%,$(firstword -$(MAKEFLAGS)))
> else
> -short-opts := $(filter-out --%,$(MAKEFLAGS))
> +short-opts := $(filter-out --% ---%,$(MAKEFLAGS))
> endif
>
> ifneq ($(findstring s,$(short-opts)),)
> --
> 2.47.1
>
>
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists