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