mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Cc: Ahmad Fatoum <afa@pengutronix.de>
Subject: [PATCH] Kbuild: do not build dtbs concurrently
Date: Thu, 28 Aug 2025 11:31:35 +0200	[thread overview]
Message-ID: <20250828093135.1959085-1-s.hauer@pengutronix.de> (raw)

commit 3c862a83f019 ("kbuild: restrict dtbs target to enabled DTs by
default") added the dtbs target as a dependency to the images target.
In the dtbs target we call into Kbuild for building the device trees.
The device trees are also built as part of the regular build in
parallel, so we end up running Kbuild for the same directory twice.

This sometimes results in failed builds with messages like this one
(done with make V=2):

  AS [P]  arch/arm/dts/bcm2711-rpi-400.dtb.pbl.o - due to target missing
  AS [P]  arch/arm/dts/bcm2711-rpi-400.dtb.pbl.o - due to target missing
fixdep: error opening file: arch/arm/dts/.bcm2711-rpi-400.dtb.pbl.o.d: No such file or directory

Fix this by removing the dtbs target from the images dependencies. We
then would no longer build the dtbs-list, so build that unconditionally
once we descend into a directory containing device trees. The dtbs-list
is built with always-y which should make sure it is ready once we need
it in imagages/

Fixes: 3c862a83f019 ("kbuild: restrict dtbs target to enabled DTs by default")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 Makefile               | 7 +------
 scripts/Makefile.build | 2 +-
 scripts/Makefile.dtbs  | 2 --
 3 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index b9c252476f..7620c47cf4 100644
--- a/Makefile
+++ b/Makefile
@@ -1187,15 +1187,10 @@ ifneq ($(dtstree),)
 
 PHONY += dtbs dtbs_prepare
 dtbs: dtbs_prepare
-	$(Q)$(MAKE) $(build)=$(dtstree) need-dtbslist=1
+	$(Q)$(MAKE) $(build)=$(dtstree)
 
 dtbs_prepare: include/config/kernel.release scripts_dtc
 
-ifdef CONFIG_OFDEVICE
-images: dtbs
-images/%: dtbs
-endif
-
 endif
 
 PHONY += scripts_dtc
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 591da3d750..fed8c247f9 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -56,7 +56,7 @@ ifneq ($(userprogs),)
 include scripts/Makefile.userprogs
 endif
 
-ifneq ($(need-dtbslist)$(dtb-y)$(dtb-)$(filter %.dtb %.dtb.o %.dtbo.o,$(targets)),)
+ifneq ($(dtb-y)$(dtb-)$(filter %.dtb %.dtb.o %.dtbo.o,$(targets)),)
 include $(srctree)/scripts/Makefile.dtbs
 endif
 
diff --git a/scripts/Makefile.dtbs b/scripts/Makefile.dtbs
index 7b5b9e1d16..25ed08e8ee 100644
--- a/scripts/Makefile.dtbs
+++ b/scripts/Makefile.dtbs
@@ -10,11 +10,9 @@ always-y        += $(dtb-y)
 # dtbs-list
 # ---------------------------------------------------------------------------
 
-ifdef need-dtbslist
 subdir-dtbslist := $(addsuffix /dtbs-list, $(subdir-ym))
 dtb-y           += $(subdir-dtbslist)
 always-y        += $(obj)/dtbs-list
-endif
 
 $(subdir-dtbslist): $(obj)/%/dtbs-list: $(obj)/% ;
 
-- 
2.47.2




                 reply	other threads:[~2025-08-28 10:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250828093135.1959085-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=afa@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox