[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.10] x86/efi: split compiler vs linker support



commit 518726dc1dd1a11668c841f4d6ea47beca18119a
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Mon Oct 8 14:37:25 2018 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Oct 8 14:37:25 2018 +0200

    x86/efi: split compiler vs linker support
    
    So that an ELF binary with support for EFI services will be built when
    the compiler supports the MS ABI, regardless of the linker support for
    PE.
    
    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Daniel Kiper <daniel.kiper@xxxxxxxxxx>
    Tested-by: Daniel Kiper <daniel.kiper@xxxxxxxxxx>
    master commit: 93249f7fc17c1f3a2aa8bf9ea055aa326e93a4ae
    master date: 2018-07-31 10:25:06 +0200
---
 xen/arch/x86/Makefile     | 9 +++++----
 xen/arch/x86/efi/Makefile | 6 +++---
 xen/arch/x86/xen.lds.S    | 2 +-
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index fd864cedf7..2ed7d54366 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -163,10 +163,11 @@ EFI_LDFLAGS += --minor-image-version=$(XEN_SUBVERSION)
 EFI_LDFLAGS += --major-os-version=2 --minor-os-version=0
 EFI_LDFLAGS += --major-subsystem-version=2 --minor-subsystem-version=0
 
-# Check if the build system supports PE.
-XEN_BUILD_PE := $(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c 
efi/check.c -o efi/check.o 2>/dev/null && echo y)
-export XEN_BUILD_PE := $(if $(XEN_BUILD_PE),$(shell $(LD) -mi386pep 
--subsystem=10 -o efi/check.efi efi/check.o 2>/dev/null && echo y))
-CFLAGS-$(XEN_BUILD_PE) += -DXEN_BUILD_PE
+# Check if the compiler supports the MS ABI.
+export XEN_BUILD_EFI := $(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(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
 
 $(TARGET).efi: VIRT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A 
VIRT_START$$,,p')
 $(TARGET).efi: ALT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A 
ALT_START$$,,p')
diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile
index 6adce38e50..de74e87cbb 100644
--- a/xen/arch/x86/efi/Makefile
+++ b/xen/arch/x86/efi/Makefile
@@ -6,6 +6,6 @@ CFLAGS += -fshort-wchar
 boot.init.o: buildid.o
 
 obj-y := stub.o
-obj-$(XEN_BUILD_PE) := boot.init.o compat.o relocs-dummy.o runtime.o
-extra-$(XEN_BUILD_PE) += buildid.o
-nogcov-$(XEN_BUILD_PE) += stub.o
+obj-$(XEN_BUILD_EFI) := boot.init.o compat.o relocs-dummy.o runtime.o
+extra-$(XEN_BUILD_EFI) += buildid.o
+nogcov-$(XEN_BUILD_EFI) += stub.o
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 4847f63b74..e1394cecfe 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -281,7 +281,7 @@ SECTIONS
   } :text
 #endif
 
-#ifndef XEN_BUILD_PE
+#ifndef XEN_BUILD_EFI
   efi = .;
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.