]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
x86/boot: Fix include paths for 32bit objects
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 3 Sep 2024 10:41:56 +0000 (11:41 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 3 Sep 2024 14:51:14 +0000 (15:51 +0100)
Most of Xen is build using -nostdinc and a fully specified include path.
However, the makefile line:

  $(head-bin-objs): XEN_CFLAGS := $(CFLAGS_x86_32) -fpic

discards XEN_CFLAGS and replaces them with CFLAGS_x86_32.

Reinstate -nostdinc, and copy the -include and all -I arguments from
XEN_CFLAGS.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/boot/Makefile

index 03d8ce3a9e48f11ec125c69c6404afbf5b272230..de4774027760329fbe3f2fcc828ca34ae171ffd1 100644 (file)
@@ -14,10 +14,8 @@ $(obj)/head.o: $(head-bin-objs:.o=.bin)
 CFLAGS_x86_32 := $(subst -m64,-m32 -march=i686,$(XEN_TREEWIDE_CFLAGS))
 $(call cc-options-add,CFLAGS_x86_32,CC,$(EMBEDDED_EXTRA_CFLAGS))
 CFLAGS_x86_32 += -Werror -fno-builtin -g0 -msoft-float
-ifneq ($(abs_objtree),$(abs_srctree))
-CFLAGS_x86_32 += -I$(objtree)/include
-endif
-CFLAGS_x86_32 += -I$(srctree)/include
+CFLAGS_x86_32 += -nostdinc -include $(filter %/include/xen/config.h,$(XEN_CFLAGS))
+CFLAGS_x86_32 += $(filter -I%,$(XEN_CFLAGS))
 
 # override for 32bit binaries
 $(head-bin-objs): CFLAGS_stack_boundary :=