On 01.07.2021 16:10, Anthony PERARD wrote:
> We are going to need the variable XEN_BUILD_EFI earlier.
> 
> This early check is using "try-run" to allow to have a temporary
> output file in case it is needed for $(CC) to build the *.c file.
> 
> The "efi/check.o" file is still needed in "arch/x86/Makefile" so the
> check is currently duplicated.

Why is this? Can't you ...

> --- a/xen/arch/x86/Makefile
> +++ b/xen/arch/x86/Makefile
> @@ -126,7 +126,7 @@ $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
>  ifneq ($(efi-y),)
>  
>  # Check if the compiler supports the MS ABI.
> -export XEN_BUILD_EFI := $(shell $(CC) $(XEN_CFLAGS) -c efi/check.c -o 
> efi/check.o 2>/dev/null && echo y)
> +XEN_BUILD_EFI := $(shell $(CC) $(XEN_CFLAGS) -c efi/check.c -o efi/check.o 
> 2>/dev/null && echo y)
>  CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI

... use here what you ...

> --- a/xen/arch/x86/arch.mk
> +++ b/xen/arch/x86/arch.mk
> @@ -60,5 +60,10 @@ ifeq ($(CONFIG_UBSAN),y)
>  $(call cc-option-add,CFLAGS_UBSAN,CC,-fno-sanitize=alignment)
>  endif
>  
> +ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y)
> +# Check if the compiler supports the MS ABI.
> +export XEN_BUILD_EFI := $(call try-run,$(CC) $(CFLAGS) -c 
> arch/x86/efi/check.c -o "$$TMPO",y)
> +endif

... export here?

Jan


Reply via email to