tools/build/Build | 2 ++ tools/build/Makefile | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 tools/build/Build
The following commit has been merged into the objtool/core branch of tip:
Commit-ID: a808a2b35f66658e6c49dc98b55a33fa1079fe72
Gitweb: https://git.kernel.org/tip/a808a2b35f66658e6c49dc98b55a33fa1079fe72
Author: Josh Poimboeuf <jpoimboe@kernel.org>
AuthorDate: Sun, 02 Mar 2025 17:01:42 -08:00
Committer: Josh Poimboeuf <jpoimboe@kernel.org>
CommitterDate: Tue, 14 Oct 2025 14:45:20 -07:00
tools build: Fix fixdep dependencies
The tools version of fixdep has broken dependencies. It doesn't get
rebuilt if the host compiler or headers change.
Build fixdep with the tools kbuild infrastructure, so fixdep runs on
itself. Due to the recursive dependency, its dependency file is
incomplete the very first time it gets built. In that case build it a
second time to achieve fixdep inception.
Reported-by: Arthur Marsh <arthur.marsh@internode.on.net>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
tools/build/Build | 2 ++
tools/build/Makefile | 23 +++++++++++++++++++++--
2 files changed, 23 insertions(+), 2 deletions(-)
create mode 100644 tools/build/Build
diff --git a/tools/build/Build b/tools/build/Build
new file mode 100644
index 0000000..1c7e598
--- /dev/null
+++ b/tools/build/Build
@@ -0,0 +1,2 @@
+hostprogs := fixdep
+fixdep-y := fixdep.o
diff --git a/tools/build/Makefile b/tools/build/Makefile
index 63ef218..a5b3c29 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -37,5 +37,24 @@ ifneq ($(wildcard $(TMP_O)),)
$(Q)$(MAKE) -C feature OUTPUT=$(TMP_O) clean >/dev/null
endif
-$(OUTPUT)fixdep: $(srctree)/tools/build/fixdep.c
- $(QUIET_CC)$(HOSTCC) $(KBUILD_HOSTCFLAGS) $(KBUILD_HOSTLDFLAGS) -o $@ $<
+include $(srctree)/tools/build/Makefile.include
+
+FIXDEP := $(OUTPUT)fixdep
+FIXDEP_IN := $(OUTPUT)fixdep-in.o
+
+# To track fixdep's dependencies properly, fixdep needs to run on itself.
+# Build it twice the first time.
+$(FIXDEP_IN): FORCE
+ $(Q)if [ ! -f $(FIXDEP) ]; then \
+ $(MAKE) $(build)=fixdep HOSTCFLAGS="$(KBUILD_HOSTCFLAGS)"; \
+ rm -f $(FIXDEP).o; \
+ fi
+ $(Q)$(MAKE) $(build)=fixdep HOSTCFLAGS="$(KBUILD_HOSTCFLAGS)"
+
+
+$(FIXDEP): $(FIXDEP_IN)
+ $(QUIET_LINK)$(HOSTCC) $(FIXDEP_IN) $(KBUILD_HOSTLDFLAGS) -o $@
+
+FORCE:
+
+.PHONY: FORCE
On Sat, Oct 18, 2025 at 07:12:02AM +0200, Thorsten Leemhuis wrote: >>On 10/16/25 11:53, tip-bot2 for Josh Poimboeuf wrote: >>>>The following commit has been merged into the objtool/core branch of tip: >>>> >>>>Commit-ID: a808a2b35f66658e6c49dc98b55a33fa1079fe72 >>>>Gitweb: https://git.kernel.org/tip/a808a2b35f66658e6c49dc98b55a33fa1079fe72 >>>>Author: Josh Poimboeuf <jpoimboe@kernel.org> >>>>AuthorDate: Sun, 02 Mar 2025 17:01:42 -08:00 >>>>Committer: Josh Poimboeuf <jpoimboe@kernel.org> >>>>CommitterDate: Tue, 14 Oct 2025 14:45:20 -07:00 >>>> >>>>tools build: Fix fixdep dependencies >>>> >>>>The tools version of fixdep has broken dependencies. It doesn't get >>>>rebuilt if the host compiler or headers change. >> >>My daily -next rebuilds based on the Fedora rawhide srpm failed due to >>this patch while building perf: >> >>make[4]: *** No rule to make target '/builddir/build/BUILD/kernel-6.18.0-build/kernel-next-20251017/linux-6.18.0-0.0.next.20251017.420.vanilla.fc44.aarch64/tools/perf/libsubcmd/fixdep'. Stop. >>make[3]: *** [/builddir/build/BUILD/kernel-6.18.0-build/kernel-next-20251017/linux-6.18.0-0.0.next.20251017.420.vanilla.fc44.aarch64/tools/build/Makefile.include:15: fixdep] Error 2 >>make[2]: *** [Makefile.perf:981: /builddir/build/BUILD/kernel-6.18.0-build/kernel-next-20251017/linux-6.18.0-0.0.next.20251017.420.vanilla.fc44.aarch64/tools/perf/libsubcmd/libsubcmd.a] Error 2 >>make[2]: *** Waiting for unfinished jobs.... >> >>Full log: https://download.copr.fedorainfracloud.org/results/@kernel-vanilla/next/fedora-rawhide-aarch64/09700031-next-next-all/builder-live.log.gz >> >>Happened on ppc64 and s390x, too (and likely on x86_64, too, but that >>failed earlier during the build due to an unrelated problem). >> >>Reverting this change fixed the problem. The LKFT also found these perf build regressions on the Linux next-20251017. Build regressions: No rule to make target 'build/libsubcmd/fixdep' Reported-by: Linux Kernel Functional Testing <lkft@linaro.org> ## Build error CC /home/tuxbuild/.cache/tuxmake/builds/1/build/libperf/core.o make[4]: *** No rule to make target '/home/tuxbuild/.cache/tuxmake/builds/1/build/libsubcmd/fixdep'. Stop. make[3]: *** [/builds/linux/tools/build/Makefile.include:15: fixdep] Error 2 make[2]: *** [Makefile.perf:981: /home/tuxbuild/.cache/tuxmake/builds/1/build/libsubcmd/libsubcmd.a] Error 2 > Thanks, I will post a fix for this shortly. When you have fix ready please CC LKFT, I am happy to test. lkft-triage@lists.linaro.org naresh.kamboju@linaro.org -- Josh
On 10/16/25 11:53, tip-bot2 for Josh Poimboeuf wrote: > The following commit has been merged into the objtool/core branch of tip: > > Commit-ID: a808a2b35f66658e6c49dc98b55a33fa1079fe72 > Gitweb: https://git.kernel.org/tip/a808a2b35f66658e6c49dc98b55a33fa1079fe72 > Author: Josh Poimboeuf <jpoimboe@kernel.org> > AuthorDate: Sun, 02 Mar 2025 17:01:42 -08:00 > Committer: Josh Poimboeuf <jpoimboe@kernel.org> > CommitterDate: Tue, 14 Oct 2025 14:45:20 -07:00 > > tools build: Fix fixdep dependencies > > The tools version of fixdep has broken dependencies. It doesn't get > rebuilt if the host compiler or headers change. My daily -next rebuilds based on the Fedora rawhide srpm failed due to this patch while building perf: make[4]: *** No rule to make target '/builddir/build/BUILD/kernel-6.18.0-build/kernel-next-20251017/linux-6.18.0-0.0.next.20251017.420.vanilla.fc44.aarch64/tools/perf/libsubcmd/fixdep'. Stop. make[3]: *** [/builddir/build/BUILD/kernel-6.18.0-build/kernel-next-20251017/linux-6.18.0-0.0.next.20251017.420.vanilla.fc44.aarch64/tools/build/Makefile.include:15: fixdep] Error 2 make[2]: *** [Makefile.perf:981: /builddir/build/BUILD/kernel-6.18.0-build/kernel-next-20251017/linux-6.18.0-0.0.next.20251017.420.vanilla.fc44.aarch64/tools/perf/libsubcmd/libsubcmd.a] Error 2 make[2]: *** Waiting for unfinished jobs.... Full log: https://download.copr.fedorainfracloud.org/results/@kernel-vanilla/next/fedora-rawhide-aarch64/09700031-next-next-all/builder-live.log.gz Happened on ppc64 and s390x, too (and likely on x86_64, too, but that failed earlier during the build due to an unrelated problem). Reverting this change fixed the problem. Ciao, Thorsten > Build fixdep with the tools kbuild infrastructure, so fixdep runs on > itself. Due to the recursive dependency, its dependency file is > incomplete the very first time it gets built. In that case build it a > second time to achieve fixdep inception. > > Reported-by: Arthur Marsh <arthur.marsh@internode.on.net> > Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> > --- > tools/build/Build | 2 ++ > tools/build/Makefile | 23 +++++++++++++++++++++-- > 2 files changed, 23 insertions(+), 2 deletions(-) > create mode 100644 tools/build/Build > > diff --git a/tools/build/Build b/tools/build/Build > new file mode 100644 > index 0000000..1c7e598 > --- /dev/null > +++ b/tools/build/Build > @@ -0,0 +1,2 @@ > +hostprogs := fixdep > +fixdep-y := fixdep.o > diff --git a/tools/build/Makefile b/tools/build/Makefile > index 63ef218..a5b3c29 100644 > --- a/tools/build/Makefile > +++ b/tools/build/Makefile > @@ -37,5 +37,24 @@ ifneq ($(wildcard $(TMP_O)),) > $(Q)$(MAKE) -C feature OUTPUT=$(TMP_O) clean >/dev/null > endif > > -$(OUTPUT)fixdep: $(srctree)/tools/build/fixdep.c > - $(QUIET_CC)$(HOSTCC) $(KBUILD_HOSTCFLAGS) $(KBUILD_HOSTLDFLAGS) -o $@ $< > +include $(srctree)/tools/build/Makefile.include > + > +FIXDEP := $(OUTPUT)fixdep > +FIXDEP_IN := $(OUTPUT)fixdep-in.o > + > +# To track fixdep's dependencies properly, fixdep needs to run on itself. > +# Build it twice the first time. > +$(FIXDEP_IN): FORCE > + $(Q)if [ ! -f $(FIXDEP) ]; then \ > + $(MAKE) $(build)=fixdep HOSTCFLAGS="$(KBUILD_HOSTCFLAGS)"; \ > + rm -f $(FIXDEP).o; \ > + fi > + $(Q)$(MAKE) $(build)=fixdep HOSTCFLAGS="$(KBUILD_HOSTCFLAGS)" > + > + > +$(FIXDEP): $(FIXDEP_IN) > + $(QUIET_LINK)$(HOSTCC) $(FIXDEP_IN) $(KBUILD_HOSTLDFLAGS) -o $@ > + > +FORCE: > + > +.PHONY: FORCE >
On Sat, Oct 18, 2025 at 07:12:02AM +0200, Thorsten Leemhuis wrote: > On 10/16/25 11:53, tip-bot2 for Josh Poimboeuf wrote: > > The following commit has been merged into the objtool/core branch of tip: > > > > Commit-ID: a808a2b35f66658e6c49dc98b55a33fa1079fe72 > > Gitweb: https://git.kernel.org/tip/a808a2b35f66658e6c49dc98b55a33fa1079fe72 > > Author: Josh Poimboeuf <jpoimboe@kernel.org> > > AuthorDate: Sun, 02 Mar 2025 17:01:42 -08:00 > > Committer: Josh Poimboeuf <jpoimboe@kernel.org> > > CommitterDate: Tue, 14 Oct 2025 14:45:20 -07:00 > > > > tools build: Fix fixdep dependencies > > > > The tools version of fixdep has broken dependencies. It doesn't get > > rebuilt if the host compiler or headers change. > > My daily -next rebuilds based on the Fedora rawhide srpm failed due to > this patch while building perf: > > make[4]: *** No rule to make target '/builddir/build/BUILD/kernel-6.18.0-build/kernel-next-20251017/linux-6.18.0-0.0.next.20251017.420.vanilla.fc44.aarch64/tools/perf/libsubcmd/fixdep'. Stop. > make[3]: *** [/builddir/build/BUILD/kernel-6.18.0-build/kernel-next-20251017/linux-6.18.0-0.0.next.20251017.420.vanilla.fc44.aarch64/tools/build/Makefile.include:15: fixdep] Error 2 > make[2]: *** [Makefile.perf:981: /builddir/build/BUILD/kernel-6.18.0-build/kernel-next-20251017/linux-6.18.0-0.0.next.20251017.420.vanilla.fc44.aarch64/tools/perf/libsubcmd/libsubcmd.a] Error 2 > make[2]: *** Waiting for unfinished jobs.... > > Full log: https://download.copr.fedorainfracloud.org/results/@kernel-vanilla/next/fedora-rawhide-aarch64/09700031-next-next-all/builder-live.log.gz > > Happened on ppc64 and s390x, too (and likely on x86_64, too, but that > failed earlier during the build due to an unrelated problem). > > Reverting this change fixed the problem. Thanks, I will post a fix for this shortly. -- Josh
© 2016 - 2026 Red Hat, Inc.