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

[xen staging] x86/EFI: correct compiler probing



commit 2f7481d59255680c1de98f43467d3862453dd50a
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Mar 7 09:14:55 2024 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Mar 7 09:14:55 2024 +0100

    x86/EFI: correct compiler probing
    
    Passing in $(CFLAGS) means also requesting inclusion of certain headers
    (via -include command line options). That's particularly xen/config.h,
    which in turn requires generated/autoconf.h. This has not caused any
    problems so far only because arch.mk is processed twice, and the missing
    header on the 1st pass would be there on the 2nd. Having added an
    inclusion of asm/asm-macros.h to x86'es asm/config.h, the 2nd pass then
    also fails on an initial, pristine build.
    
    As per dd40177c1bc8 ("x86-64/EFI: add CFLAGS to check compile") dropping
    the use of $(CFLAGS) altogether isn't an option, though. Hence remove
    the problematic options only.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 xen/arch/x86/arch.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 751fd8d410..4f6c086988 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -87,7 +87,8 @@ efi-check := arch/x86/efi/check
 $(shell mkdir -p $(dir $(efi-check)))
 
 # Check if the compiler supports the MS ABI.
-XEN_BUILD_EFI := $(call if-success,$(CC) $(CFLAGS) -c 
$(srctree)/$(efi-check).c -o $(efi-check).o,y)
+XEN_BUILD_EFI := $(call if-success,$(CC) $(filter-out -include 
%/include/xen/config.h,$(CFLAGS)) \
+                                         -c $(srctree)/$(efi-check).c -o 
$(efi-check).o,y)
 
 # Check if the linker supports PE.
 EFI_LDFLAGS := $(patsubst -m%,-mi386pep,$(LDFLAGS)) --subsystem=10
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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