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 <damien.lemoal@wdc.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Damien Le Moal 2021-10-26 16:17:19 +09:00 committed by Peter Korsgaard
parent cc26ee8e1b
commit 04d7ea4720

View File

@ -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)