--- xen-4.16.0/xen/arch/x86/Makefile.orig 2021-11-30 11:42:42.000000000 +0000 +++ xen-4.16.0/xen/arch/x86/Makefile 2022-03-17 22:43:21.077990559 +0000 @@ -127,7 +127,8 @@ CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI # Check if the linker supports PE. -EFI_LDFLAGS = $(patsubst -m%,-mi386pep,$(XEN_LDFLAGS)) --subsystem=10 +#EFI_LDFLAGS = $(patsubst -m%,-mi386pep,$(XEN_LDFLAGS)) --subsystem=10 +EFI_LDFLAGS = --as-needed --build-id=sha1 -mi386pep --subsystem=10 XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(call ld-option,$(EFI_LDFLAGS) --image-base=0x100000000 -o efi/check.efi efi/check.o)) # If the above failed, it may be merely because of the linker not dealing well # with debug info. Try again with stripping it.