From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
Barebox List <barebox@lists.infradead.org>
Cc: Ahmad Fatoum <afa@pengutronix.de>
Subject: Re: [PATCH] Kbuild: do not build dtbs concurrently
Date: Mon, 1 Sep 2025 12:39:15 +0200 [thread overview]
Message-ID: <fa6f678f-7e79-401c-b857-43d34885ef6e@pengutronix.de> (raw)
In-Reply-To: <20250828093135.1959085-1-s.hauer@pengutronix.de>
On 8/28/25 11:31 AM, Sascha Hauer wrote:
> 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>
Reviewed-by: Ahmad Fatoum <a.fatoum@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)/% ;
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2025-09-01 12:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-28 9:31 Sascha Hauer
2025-09-01 10:39 ` Ahmad Fatoum [this message]
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=fa6f678f-7e79-401c-b857-43d34885ef6e@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=afa@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/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