From 04d7ea4720cbc1e9c4d7ec6307aff71567b0653d Mon Sep 17 00:00:00 2001 From: Damien Le Moal Date: Tue, 26 Oct 2021 16:17:19 +0900 Subject: [PATCH] package: Makefile.in: fix elf2flt invocation options When BR2_BINFMT_FLAT_ONE is selected, elf2flt must be invoked with the "-r" option to ensure that a single contiguous binary image is created, regardless of the architecture default image format implemented by elf2flt. Signed-off-by: Damien Le Moal Signed-off-by: Peter Korsgaard --- package/Makefile.in | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/package/Makefile.in b/package/Makefile.in index 86db62ba5b..50ccd0f25d 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -178,13 +178,19 @@ TARGET_CXXFLAGS += -fno-dwarf2-cfi-asm endif ifeq ($(BR2_BINFMT_FLAT),y) -TARGET_CFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\ +ifeq ($(BR2_BINFMT_FLAT_ONE),y) +ELF2FLT_FLAGS = $(if $($(PKG)_FLAT_STACKSIZE),\ + -Wl$(comma)-elf2flt="-r -s$($(PKG)_FLAT_STACKSIZE)",\ + -Wl$(comma)-elf2flt=-r) +else +ELF2FLT_FLAGS = $(if $($(PKG)_FLAT_STACKSIZE),\ + -Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\ -Wl$(comma)-elf2flt) -TARGET_CXXFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\ - -Wl$(comma)-elf2flt) -TARGET_FCFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\ - -Wl$(comma)-elf2flt) -TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt) +endif +TARGET_CFLAGS += $(ELF2FLT_FLAGS) +TARGET_CXXFLAGS += $(ELF2FLT_FLAGS) +TARGET_FCFLAGS += $(ELF2FLT_FLAGS) +TARGET_LDFLAGS += $(ELF2FLT_FLAGS) endif ifeq ($(BR2_BINFMT_FLAT_SHARED),y)