x86/efi: move the logic to detect PE build support
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 31 Jul 2018 08:24:22 +0000 (10:24 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 31 Jul 2018 08:24:22 +0000 (10:24 +0200)
commit18cd4997d26b9df95dda87503e41c823279a07a0
treed3944cab407930a6da61bd58989194fc94db9e67
parent38e53a33795a88f305f30f63b7f9548e446ba2ab
x86/efi: move the logic to detect PE build support

So that it can be used by other components apart from the efi specific
code. By moving the detection code creating a dummy efi/disabled file
can be avoided.

This is required so that the conditional used to define the efi symbol
in the linker script can be removed and instead the definition of the
efi symbol can be guarded using the preprocessor.

The motivation behind this change is to be able to build Xen using lld
(the LLVM linker), that at least on version 6.0.0 doesn't work
properly with a DEFINED being used in a conditional expression:

ld    -melf_x86_64_fbsd  -T xen.lds -N prelink.o --build-id=sha1 \
    /root/src/xen/xen/common/symbols-dummy.o -o /root/src/xen/xen/.xen-syms.0
ld: error: xen.lds:233: symbol not found: efi

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Daniel Kiper <daniel.kiper@oracle.com>
.gitignore
xen/arch/x86/Makefile
xen/arch/x86/efi/Makefile
xen/arch/x86/xen.lds.S