[PATCH v2025.09.y 12/58] sandbox: fix make dependency for sandbox
Ahmad Fatoum
a.fatoum at pengutronix.de
Fri Mar 13 06:24:56 PDT 2026
From: Ahmad Fatoum <a.fatoum at barebox.org>
The final barebox ELF didn't have a dependency on barebox.o, which means
that the final executable wasn't always updated.
Fix this by adding barebox.o into BAREBOX_PIGGY_OBJS, as the .elf
rule already has $(BAREBOX_PIGGY_OBJS) as dependency.
(cherry picked from commit 82854ee1ff6d63469cf3bd4a714371afc9508eec)
Fixes: 2aba0017c95a ("sandbox: switch to using PBL")
Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
Link: https://lore.barebox.org/20260105081251.3244288-2-a.fatoum@barebox.org
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
images/Makefile | 2 ++
images/Makefile.sandbox | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/images/Makefile b/images/Makefile
index 7406aee817a3..beb262acc144 100644
--- a/images/Makefile
+++ b/images/Makefile
@@ -58,6 +58,8 @@ $(pbl-lds): $(obj)/../arch/$(SRCARCH)/lib/pbl.lds.S FORCE
ifeq ($(CONFIG_PBL_IMAGE_NO_PIGGY),)
BAREBOX_PIGGY_OBJS = $(obj)/piggy.o $(obj)/sha_sum.o
+else
+BAREBOX_PIGGY_OBJS = $(obj)/../$(BAREBOX_PROPER)
endif
quiet_cmd_elf__ ?= LD $@
diff --git a/images/Makefile.sandbox b/images/Makefile.sandbox
index 5f94b6e589e8..210a7bf48ac8 100644
--- a/images/Makefile.sandbox
+++ b/images/Makefile.sandbox
@@ -21,7 +21,7 @@ endif
quiet_cmd_elf__ = LD $@
cmd_elf__ = $(linker) -o $@ $(BAREBOX_LDFLAGS) \
-Wl,-T,$(pbl-lds) -Wl,--defsym=main=$(2) -Wl,--whole-archive \
- $(obj)/../$(BAREBOX_PROPER) $(BAREBOX_PBL_OBJS) -Wl,--no-whole-archive \
+ $(BAREBOX_PIGGY_OBJS) $(BAREBOX_PBL_OBJS) -Wl,--no-whole-archive \
-lrt -pthread $(SANDBOX_LIBS) $(LDFLAGS_$(@F))
ifeq ($(CONFIG_FUZZ_EXTERNAL),y)
--
2.47.3
More information about the barebox
mailing list