[PATCH 06/17] MIPS: pbl: fix linking errors with CONFIG_64BIT

Denis Orlov denorl2009 at gmail.com
Mon Jun 5 13:10:37 PDT 2023


For some reasons, object file format was not passed to the linker when
linking PBL, leading for a bunch of "ABI is incompatible with that of
the selected emulation" errors. Fix it, and also remove duplicate flags
being passed when linking barebox proper.

Signed-off-by: Denis Orlov <denorl2009 at gmail.com>
---
 arch/mips/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 345e703d33..bad6e574c4 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -45,8 +45,8 @@ mips-ldflags-y += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL
 endif
 
 KBUILD_LDFLAGS += $(mips-ldflags-y) -m $(ld-emul)
-LDFLAGS_barebox += $(mips-ldflags-y)
-LDFLAGS_pbl += $(mips-ldflags-y)
+LDFLAGS_barebox += $(KBUILD_LDFLAGS)
+LDFLAGS_pbl += $(KBUILD_LDFLAGS)
 
 #
 # CPU-dependent compiler/assembler options for optimization.
@@ -100,7 +100,7 @@ KBUILD_CFLAGS += $(cflags-y)
 
 lds-$(CONFIG_GENERIC_LINKER_SCRIPT)   := arch/mips/lib/barebox.lds
 
-cmd_barebox__ ?= $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_barebox) -o $@ \
+cmd_barebox__ ?= $(LD) $(LDFLAGS_barebox) -o $@ \
       -T $(BAREBOX_LDS)                         \
       --whole-archive $(BAREBOX_OBJS) --no-whole-archive        \
       $(filter-out $(BAREBOX_LDS) $(BAREBOX_OBJS) FORCE ,$^);	\
-- 
2.41.0




More information about the barebox mailing list