[PATCH 25/31] Makefile: Disable unsupported compiler options with PE

Tom Rini trini at konsulko.com
Tue Apr 25 17:59:32 CEST 2023


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 <sjg at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20230425/589b0ad5/attachment.sig>


More information about the U-Boot mailing list