[packages/kernel] upstream fix for silent mode detection with make 4.4

atler atler at pld-linux.org
Wed Dec 7 18:59:07 CET 2022


commit 3d666e8234d06f4f083105ead9c3201569406b98
Author: Jan Palus <atler at pld-linux.org>
Date:   Wed Dec 7 18:57:32 2022 +0100

    upstream fix for silent mode detection with make 4.4

 kernel.spec    |  2 ++
 make-4.4.patch | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+)
---
diff --git a/kernel.spec b/kernel.spec
index 976302db..ea86de74 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -151,6 +151,7 @@ Source55:	kernel-imq.config
 
 Source58:	kernel-inittmpfs.config
 
+Patch1:		make-4.4.patch
 # http://dev.gentoo.org/~spock/projects/fbcondecor/archive/fbcondecor-0.9.4-2.6.25-rc6.patch
 Patch3:		kernel-fbcondecor.patch
 Patch6:		linux-wistron-nx.patch
@@ -608,6 +609,7 @@ cd linux-%{basever}
 %endif
 
 %if %{without vanilla}
+%patch1 -p1
 
 %if %{with fbcondecor}
 %patch3 -p1
diff --git a/make-4.4.patch b/make-4.4.patch
new file mode 100644
index 00000000..46ae0e30
--- /dev/null
+++ b/make-4.4.patch
@@ -0,0 +1,73 @@
+From 22c65447a7a4667b91ce82a027c91005df136768 Mon Sep 17 00:00:00 2001
+From: Dmitry Goncharov <dgoncharov at users.sf.net>
+Date: Mon, 5 Dec 2022 16:48:19 -0500
+Subject: kbuild: Port silent mode detection to future gnu make.
+
+Port silent mode detection to the future (post make-4.4) versions of gnu make.
+
+Makefile contains the following piece of make code to detect if option -s is
+specified on the command line.
+
+ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
+
+This code is executed by make at parse time and assumes that MAKEFLAGS
+does not contain command line variable definitions.
+Currently if the user defines a=s on the command line, then at build only
+time MAKEFLAGS contains " -- a=s".
+However, starting with commit dc2d963989b96161472b2cd38cef5d1f4851ea34
+MAKEFLAGS contains command line definitions at both parse time and
+build time.
+
+This '-s' detection code then confuses a command line variable
+definition which contains letter 's' with option -s.
+
+$ # old make
+$ make net/wireless/ocb.o a=s
+  CALL    scripts/checksyscalls.sh
+  DESCEND objtool
+$ # this a new make which defines makeflags at parse time
+$ ~/src/gmake/make/l64/make net/wireless/ocb.o a=s
+$
+
+We can see here that the letter 's' from 'a=s' was confused with -s.
+
+This patch checks for presence of -s using a method recommended by the
+make manual here
+https://www.gnu.org/software/make/manual/make.html#Testing-Flags.
+
+Link: https://lists.gnu.org/archive/html/bug-make/2022-11/msg00190.html
+Reported-by: Jan Palus <jpalus+gnu at fastmail.com>
+Signed-off-by: Dmitry Goncharov <dgoncharov at users.sf.net>
+Signed-off-by: Masahiro Yamada <masahiroy at kernel.org>
+---
+ Makefile | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 797fafbc1b45c..53fa1a9fba8aa 100644
+--- a/Makefile
++++ b/Makefile
+@@ -93,10 +93,17 @@ 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.
+ 
+-ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
+-  quiet=silent_
+-  KBUILD_VERBOSE = 0
++ifeq ($(filter 3.%,$(MAKE_VERSION)),)
++silence:=$(findstring s,$(firstword -$(MAKEFLAGS)))
++else
++silence:=$(findstring s,$(filter-out --%,$(MAKEFLAGS)))
++endif
++
++ifeq ($(silence),s)
++quiet=silent_
++KBUILD_VERBOSE = 0
+ endif
+ 
+ export quiet Q KBUILD_VERBOSE
+-- 
+cgit 
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/kernel.git/commitdiff/3d666e8234d06f4f083105ead9c3201569406b98



More information about the pld-cvs-commit mailing list