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: move PBL_CODE_SIZE_ out of rule_pblb
Date: Mon, 25 Aug 2025 15:18:06 +0200	[thread overview]
Message-ID: <20250825131806.2050398-1-s.hauer@pengutronix.de> (raw)

Before Commit 21613ae35f ("kbuild: images/Makefile: fix broken if_changed usage")
setting of PBL_CODE_SIZE_$*, PBL_MEMORY_SIZE_$* and PBL_IMAGE_SIZE_$*
were part of the

$(obj)/%.pblb: $(obj)/%.pbl FORCE

rule which was always executed due to the FORCE. Beginning with this
commit setting of these variables are part of rule_pblb which is only
executed when the pblb file is (re-)generated. In case the pblb is still
up to date this results in the variables being unset which then fails
in later stages.

Move setting of the variables back to the pblb rule to make sure they
are always set.

Reproducer:

make multi_v8_defconfig && make && make

The second make will fail while calling the imx-image tool which gets
the -p option without the actual size as optarg.

Fixes: 21613ae35f ("kbuild: images/Makefile: fix broken if_changed usage")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 images/Makefile | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/images/Makefile b/images/Makefile
index 03c7fdc024..7406aee817 100644
--- a/images/Makefile
+++ b/images/Makefile
@@ -99,13 +99,6 @@ define rule_pblb
 	$(call cmd,check_missing_fw,$@,$<)
 	$(call cmd,check_file_size,$@,$(CONFIG_BAREBOX_MAX_IMAGE_SIZE))
 
-	$(eval PBL_CODE_SIZE_$* = \
-		$(shell $(srctree)/scripts/extract_symbol_offset pbl_code_size $^))
-	$(eval PBL_MEMORY_SIZE_$*= \
-		$(shell $(srctree)/scripts/extract_symbol_offset pbl_memory_size $^))
-	$(eval PBL_IMAGE_SIZE_$*= \
-		$(shell $(srctree)/scripts/extract_symbol_offset pbl_image_size $^))
-
 	$(if $(MAX_PBL_CODE_SIZE_$*), \
 		$(call cmd,check_size,$(PBL_CODE_SIZE_$*),$(MAX_PBL_CODE_SIZE_$*)) \
 	)
@@ -120,6 +113,13 @@ define rule_pblb
 endef
 
 $(obj)/%.pblb: $(obj)/%.pbl FORCE
+	$(eval PBL_CODE_SIZE_$* = \
+		$(shell $(srctree)/scripts/extract_symbol_offset pbl_code_size $^))
+	$(eval PBL_MEMORY_SIZE_$*= \
+		$(shell $(srctree)/scripts/extract_symbol_offset pbl_memory_size $^))
+	$(eval PBL_IMAGE_SIZE_$*= \
+		$(shell $(srctree)/scripts/extract_symbol_offset pbl_image_size $^))
+
 	$(call if_changed_rule,pblb)
 
 $(obj)/%.s: $(obj)/% FORCE
-- 
2.47.2




                 reply	other threads:[~2025-08-25 15:00 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=20250825131806.2050398-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