mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master] kbuild: do not descend into images/ twice
Date: Thu,  4 Sep 2025 10:14:58 +0200	[thread overview]
Message-ID: <20250904081459.91984-1-a.fatoum@pengutronix.de> (raw)

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




                 reply	other threads:[~2025-09-04  8:56 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=20250904081459.91984-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@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