On Mon, Apr 24, 2023 at 05:08:30PM -0600, Simon Glass wrote: > The MSYS2 compiler does not support some of these options. Drop them to > avoid build errors. > > Signed-off-by: Simon Glass <s...@chromium.org> > --- > > Makefile | 2 ++ > scripts/Makefile.lib | 5 ++++- > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/Makefile b/Makefile > index 0aa97a2c3b48..773260b81d5d 100644 > --- a/Makefile > +++ b/Makefile > @@ -818,7 +818,9 @@ KBUILD_CPPFLAGS += $(KCPPFLAGS) > KBUILD_AFLAGS += $(KAFLAGS) > KBUILD_CFLAGS += $(KCFLAGS) > > +ifeq ($(MSYS_VERSION),0) > KBUILD_LDFLAGS += -z noexecstack > +endif > KBUILD_LDFLAGS += $(call ld-option,--no-warn-rwx-segments) > > KBUILD_HOSTCFLAGS += $(if $(CONFIG_TOOLS_DEBUG),-g) > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > index 7b27224b5d44..d309e26aaec8 100644 > --- a/scripts/Makefile.lib > +++ b/scripts/Makefile.lib > @@ -425,7 +425,10 @@ cmd_efi_objcopy = $(OBJCOPY) -j .header -j .text -j > .sdata -j .data -j \ > $(obj)/%.efi: $(obj)/%_efi.so > $(call cmd,efi_objcopy) > > -KBUILD_EFILDFLAGS = -nostdlib -zexecstack -znocombreloc -znorelro > +KBUILD_EFILDFLAGS = -nostdlib > +ifeq ($(MSYS_VERSION),0) > +KBUILD_EFILDFLAGS += -zexecstack -znocombreloc -znorelro > +endif > KBUILD_EFILDFLAGS += $(call ld-option,--no-warn-rwx-segments) > quiet_cmd_efi_ld = LD $@ > cmd_efi_ld = $(LD) $(KBUILD_EFILDFLAGS) -T $(EFI_LDS_PATH) \
We should use $(call ld-option,...) here instead. -- Tom
signature.asc
Description: PGP signature