[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250402075253.1772541-1-luriwen@kylinos.cn>
Date: Wed, 2 Apr 2025 15:52:53 +0800
From: Riwen Lu <luriwen@...inos.cn>
To: o-takashi@...amocchi.jp,
rafael@...nel.org,
lenb@...nel.org,
robert.moore@...el.com
Cc: linux1394-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org,
linux-acpi@...r.kernel.org,
acpica-devel@...ts.linux.dev,
yu.c.chen@...el.com,
Riwen Lu <luriwen@...inos.cn>,
k2ci <kernel-bot@...inos.cn>
Subject: [PATCH v2] tools: Restore built-in rules for subdirectory tool compilation
Prior to commit d1d096312176 ("tools: fix annoying "mkdir -p ..." logs
when building tools in parallel"), the top-level MAKEFLAGS=-rR
(disabling built-in rules/variables) was overridden by
subdirectory-specific MAKEFLAGS during tools compilation. This allowed
tools like pfrut and firewire to implicitly rely on Make's built-in rules.
After the aforementioned commit, the -rR flags from the top-level
Makefile began propagating to subdirectory builds. This broke tools
depending on implicit rules because:
1. -r (--no-builtin-rules) disabled implicit .c -> .o rules
2. -R (--no-builtin-variables) hid critical implicit variables like CC
Fix this by filtering out -rR from MAKEFLAGS.
Fixes: d1d096312176 ("tools: fix annoying "mkdir -p ..." logs when building tools in parallel")
Reported-by: k2ci <kernel-bot@...inos.cn>
Signed-off-by: Riwen Lu <luriwen@...inos.cn>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index d138b17b8840..abf9cfebaf4f 100644
--- a/Makefile
+++ b/Makefile
@@ -1431,11 +1431,11 @@ endif
tools/: FORCE
$(Q)mkdir -p $(objtree)/tools
- $(Q)$(MAKE) LDFLAGS= O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/
+ $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter-out rR,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/
tools/%: FORCE
$(Q)mkdir -p $(objtree)/tools
- $(Q)$(MAKE) LDFLAGS= O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ $*
+ $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter-out rR,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ $*
# ---------------------------------------------------------------------------
# Kernel selftest
--
2.25.1
Powered by blists - more mailing lists