[PATCH] perf build: Fix perf build issues with fixdep

Josh Poimboeuf posted 1 patch 3 months, 2 weeks ago
There is a newer version of this series
tools/build/Makefile     | 2 --
tools/perf/Makefile.perf | 6 +++---
2 files changed, 3 insertions(+), 5 deletions(-)
[PATCH] perf build: Fix perf build issues with fixdep
Posted by Josh Poimboeuf 3 months, 2 weeks ago
Commit a808a2b35f66 ("tools build: Fix fixdep dependencies") broke the
perf build ("make -C tools/perf") by introducing two inadvertent
conflicts:

  1) tools/build/Makefile includes tools/build/Makefile.include, which
     defines a phony 'fixdep' target.  This conflicts with the $(FIXDEP)
     file target in tools/build/Makefile when OUTPUT is empty, causing
     make to report duplicate recipes for the same target.

  2) The FIXDEP variable in tools/build/Makefile conflicts with the
     previously existing one in tools/perf/Makefile.perf.

Remove the unnecessary include of tools/build/Makefile.include from
tools/build/Makefile, and rename the FIXDEP variable in
tools/perf/Makefile.perf to FIXDEP_BUILT.

Fixes: a808a2b35f66 ("tools build: Fix fixdep dependencies")
Reported-by: Thorsten Leemhuis <linux@leemhuis.info>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
 tools/build/Makefile     | 2 --
 tools/perf/Makefile.perf | 6 +++---
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/build/Makefile b/tools/build/Makefile
index a5b3c29b8d70c..3a5a3808ab2a1 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -37,8 +37,6 @@ ifneq ($(wildcard $(TMP_O)),)
 	$(Q)$(MAKE) -C feature OUTPUT=$(TMP_O) clean >/dev/null
 endif
 
-include $(srctree)/tools/build/Makefile.include
-
 FIXDEP		:= $(OUTPUT)fixdep
 FIXDEP_IN	:= $(OUTPUT)fixdep-in.o
 
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 47c906b807ef2..02f87c49801fc 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -234,12 +234,12 @@ endif
 # The fixdep build - we force fixdep tool to be built as
 # the first target in the separate make session not to be
 # disturbed by any parallel make jobs. Once fixdep is done
-# we issue the requested build with FIXDEP=1 variable.
+# we issue the requested build with FIXDEP_BUILT=1 variable.
 #
 # The fixdep build is disabled for $(NON_CONFIG_TARGETS)
 # targets, because it's not necessary.
 
-ifdef FIXDEP
+ifdef FIXDEP_BUILT
   force_fixdep := 0
 else
   force_fixdep := $(config)
@@ -286,7 +286,7 @@ $(goals) all: sub-make
 
 sub-make: fixdep
 	@./check-headers.sh
-	$(Q)$(MAKE) FIXDEP=1 -f Makefile.perf $(goals)
+	$(Q)$(MAKE) FIXDEP_BUILT=1 -f Makefile.perf $(goals)
 
 else # force_fixdep
 
-- 
2.51.0
Re: [PATCH] perf build: Fix perf build issues with fixdep
Posted by Thorsten Leemhuis 3 months, 2 weeks ago

On 10/20/25 22:33, Josh Poimboeuf wrote:
> Commit a808a2b35f66 ("tools build: Fix fixdep dependencies") broke the
> perf build ("make -C tools/perf") by introducing two inadvertent
> conflicts:
> 
>   1) tools/build/Makefile includes tools/build/Makefile.include, which
>      defines a phony 'fixdep' target.  This conflicts with the $(FIXDEP)
>      file target in tools/build/Makefile when OUTPUT is empty, causing
>      make to report duplicate recipes for the same target.
> 
>   2) The FIXDEP variable in tools/build/Makefile conflicts with the
>      previously existing one in tools/perf/Makefile.perf.
> 
> Remove the unnecessary include of tools/build/Makefile.include from
> tools/build/Makefile, and rename the FIXDEP variable in
> tools/perf/Makefile.perf to FIXDEP_BUILT.
> 
> Fixes: a808a2b35f66 ("tools build: Fix fixdep dependencies")
> Reported-by: Thorsten Leemhuis <linux@leemhuis.info>

Many thx, that did the trick for me.

Closes:
https://lore.kernel.org/all/c1d395c6-2d3b-4504-befe-6e67c7ed96fc@leemhuis.info/
Tested-by: Thorsten Leemhuis <linux@leemhuis.info>

Ciao, Thorsten