[PATCH] tools/build: Skip jobserver flgas in -s detection
From: Daniel Xu
Date: Sat Feb 01 2025 - 15:12:06 EST
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@xxxxxxxxx>
---
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