On Sun, Jul 19, 2026 at 11:59:29AM -0600, Simon Glass wrote: > Hi Denis, > > On 2026-07-16T20:52:14, None <[email protected]> wrote: > > x86: add support for CONFIG_REMAKE_ELF > > > > Fix objcopy/ld parameters for x86 to enable CONFIG_REMAKE_ELF > > configurations. > > > > That adds new 'PLATFORM_ELF_ELFLDFLAGS' make variable for injecting > > proper linker arguments when u-boot.elf is requested. > > > > Signed-off-by: Denis Mukhin <[email protected]> > > > > Makefile | 1 + > > arch/x86/config.mk | 8 ++++++-- > > 2 files changed, 7 insertions(+), 2 deletions(-) > > > That adds new 'PLATFORM_ELF_ELFLDFLAGS' make variable for injecting > > proper linker arguments when u-boot.elf is requested. > > The variable is actually called PLATFORM_ELFLDFLAGS - please can you > fix the name here. Also, please use the imperative ("Add a new ... > variable") and mention what fails today when CONFIG_REMAKE_ELF is > enabled on x86 (presumably ld picking the wrong emulation). > > > diff --git a/Makefile b/Makefile > > @@ -2003,6 +2003,7 @@ u-boot-with-spl-pbl.bin: spl/u-boot-spl.pbl > > $(UBOOT_BINLOAD) FORCE > > quiet_cmd_u-boot-elf ?= LD $@ > > cmd_u-boot-elf ?= $(LD) u-boot-elf.o -o $@ \ > > $(if $(CONFIG_SYS_BIG_ENDIAN),-EB,-EL) \ > > + $(PLATFORM_ELFLDFLAGS) \ > > Please can you add the same to cmd_u-boot-spl-elf just below, > otherwise CONFIG_SPL_REMAKE_ELF still fails on x86 (SPL is always > 32-bit, so it wants -m elf_i386). > > > diff --git a/arch/x86/config.mk b/arch/x86/config.mk > > @@ -24,9 +24,13 @@ EFI_IS_32BIT := > > -PLATFORM_CPPFLAGS += -march=i386 -m32 > > +PLATFORM_CPPFLAGS += -march=i386 -m32 > > +PLATFORM_ELFFLAGS += -O elf32-i386 -B i386 > > +PLATFORM_ELFLDFLAGS += -m elf_i386 > > Please drop the whitespace churn on the existing PLATFORM_CPPFLAGS > lines - the rest of the file uses a single space before += > > BTW, further down this file there is already: > > KBUILD_LDFLAGS += -m $(if $(IS_32BIT),elf_i386,elf_x86_64) > > so you could set PLATFORM_ELFLDFLAGS the same way in one line outside > the ifeq, next to that. What do you think?
Will update! > > I'm also interested in which x86 platform you are using - I am working > on getting Alder Lake supported at the moment. Thanks for asking. Unfortunately, I'm not able to share details about the platform. > > Regards, > Simon
