mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] kbuild: move PBL_CODE_SIZE_ out of rule_pblb
@ 2025-08-25 13:18 Sascha Hauer
  2025-08-26  5:08 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2025-08-25 13:18 UTC (permalink / raw)
  To: Barebox List; +Cc: Ahmad Fatoum

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-26  5:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-25 13:18 [PATCH] kbuild: move PBL_CODE_SIZE_ out of rule_pblb Sascha Hauer
2025-08-26  5:08 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox