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

Pali Rohár pali at kernel.org
Tue Apr 25 18:22:33 CEST 2023


On Monday 24 April 2023 17:08:30 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

What about rather using $(call ...) instead of ifeq?

> +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) \
> -- 
> 2.40.0.634.g4ca3ef3211-goog
> 


More information about the U-Boot mailing list