diff mbox series

[XEN,v2.1,14/12] squash! xen/build: introduce ccflags-y and CFLAGS_$@

Message ID 20200121135916.1140483-2-anthony.perard@citrix.com (mailing list archive)
State Superseded
Headers show
Series xen: Build system improvements | expand

Commit Message

Anthony PERARD Jan. 21, 2020, 1:59 p.m. UTC
-DXEN_BUILD_EFI and -DBUILD_ID_EFI seems to only be used in xen.lds.S
which is build using the AFLAGS, so add those flags only to asflags-y.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
That fix build of xen.efi.

Should add asflags-y into the patch title.
---
 xen/Rules.mk          | 4 +++-
 xen/arch/x86/Makefile | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 4051d60addb5..add7cad93e4e 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -39,6 +39,7 @@  ALL_OBJS-$(CONFIG_CRYPTO)   += $(BASEDIR)/crypto/built_in.o
 
 # Initialise some variables
 ccflags-y :=
+asflags-y :=
 # Allow arch specific cflags, to be calculated for each objects.
 arch_ccflags =
 
@@ -101,7 +102,8 @@  c_flags = -MMD -MF $(@D)/.$(@F).d \
           $(ccflags-y) $(CFLAGS_$(target-stem).o)
 
 a_flags = -MMD -MF $(@D)/.$(@F).d \
-          $(XEN_AFLAGS)
+          $(XEN_AFLAGS) \
+          $(asflags-y)
 
 built_in.o: $(obj-y) $(extra-y)
 ifeq ($(obj-y),)
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 191e2173315a..1e013ee31131 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -174,14 +174,14 @@  EFI_LDFLAGS += --major-subsystem-version=2 --minor-subsystem-version=0
 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))
-ccflags-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
+asflags-$(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')
 
 ifneq ($(build_id_linker),)
 ifeq ($(call ld-ver-build-id,$(LD) $(filter -m%,$(EFI_LDFLAGS))),y)
-ccflags-y += -DBUILD_ID_EFI
+asflags-y += -DBUILD_ID_EFI
 EFI_LDFLAGS += $(build_id_linker)
 note_file := efi/buildid.o
 # NB: this must be the last input in the linker call, because inputs following