* [PATCH master] kbuild: do not descend into images/ twice
@ 2025-09-04 8:14 Ahmad Fatoum
0 siblings, 0 replies; only message in thread
From: Ahmad Fatoum @ 2025-09-04 8:14 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
By having a dependency on images/barebox-dt-2nd.img for the symlink we
may hit a race where the rule for barebox-dt-2nd.img inside in
images/Makefile is executed twice leading to build breakage.
Fix this by changing the dependency in the top-level Makefile to be on
images/, so make doesn't attempt descending twice into images/Makefile
in parallel.
Fixes: a1f893cc16e6 ("kbuild: collect compatibility symlink creation in symlink-y")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
Makefile | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 7620c47cf459..169b750fe151 100644
--- a/Makefile
+++ b/Makefile
@@ -829,6 +829,7 @@ images/%: $(BAREBOX_PROPER) FORCE
ifdef CONFIG_PBL_IMAGE
SYMLINK_TARGET_barebox.efi = images/barebox-dt-2nd.img
+SYMLINK_DEP_barebox.efi = images
symlink-$(CONFIG_EFI_STUB) += barebox.efi
all: $(BAREBOX_PROPER) images
else
@@ -840,8 +841,8 @@ endif
all: $(symlink-y)
.SECONDEXPANSION:
-$(symlink-y): $$(SYMLINK_TARGET_$$(@F)) FORCE
- $(call if_changed,symlink_quiet)
+$(symlink-y): $$(or $$(SYMLINK_DEP_$$(@F)),$$(SYMLINK_TARGET_$$(@F))) FORCE
+ @ln -fsn --relative $(SYMLINK_TARGET_$(@F)) $@
common-$(CONFIG_PBL_IMAGE) += pbl/
common-$(CONFIG_DEFAULT_ENVIRONMENT) += defaultenv/
--
2.47.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-09-04 8:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-04 8:14 [PATCH master] kbuild: do not descend into images/ twice Ahmad Fatoum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox