From de58ea464fb6db4b78102edc8ac4598d4eebe6c5 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Thu, 27 Aug 2020 09:51:07 +0200 Subject: [PATCH] x86: don't build with EFI support in shim-exclusive mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit There's no need for xen.efi at all, and there's also no need for EFI support in xen.gz since the shim runs in PVH mode, i.e. without any firmware (and hence by implication also without EFI one). The slightly odd looking use of $(space) is to ensure the new ifneq() evaluates consistently between "build" and "install" invocations of make. Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monné --- xen/arch/x86/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 7d89467dc9..93e6dcdc70 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -80,7 +80,9 @@ x86_emulate.o: x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h efi-y := $(shell if [ ! -r $(BASEDIR)/include/xen/compile.h -o \ -O $(BASEDIR)/include/xen/compile.h ]; then \ - echo '$(TARGET).efi'; fi) + echo '$(TARGET).efi'; fi) \ + $(space) +efi-$(CONFIG_PV_SHIM_EXCLUSIVE) := ifneq ($(build_id_linker),) notes_phdrs = --notes @@ -113,11 +115,13 @@ $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32 { echo "No Multiboot2 header found" >&2; false; } mv $(TMP) $(TARGET) +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) # Check if the linker supports PE. XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -o efi/check.efi efi/check.o 2>/dev/null && echo y)) CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI +endif ALL_OBJS := $(BASEDIR)/arch/x86/boot/built_in.o $(BASEDIR)/arch/x86/efi/built_in.o $(ALL_OBJS) EFI_OBJS-$(XEN_BUILD_EFI) := efi/relocs-dummy.o -- 2.39.5