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

[xen stable-4.13] build: fix dependency tracking for preprocessed files



commit 27d4f1ac67a99a7f4d098d7d7339cb9050aa8218
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Jun 24 16:46:49 2020 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jun 24 16:46:49 2020 +0200

    build: fix dependency tracking for preprocessed files
    
    While the issue is more general, I noticed that asm-macros.i not getting
    re-generated as needed. This was due to its .*.d file mentioning
    asm-macros.o instead of asm-macros.i. Use -MQ here as well, and while at
    it also use -MQ to avoid the somewhat fragile sed-ary on the *.lds
    dependency tracking files. While there, further avoid open-coding $(CPP)
    and drop the bogus (Arm) / stale (x86) -Ui386.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
    master commit: 75131ad75bb3c91717b5dfda6881e61c52bfd22e
    master date: 2020-06-08 10:25:40 +0200
---
 xen/Rules.mk          | 4 ++--
 xen/arch/arm/Makefile | 4 +---
 xen/arch/x86/Makefile | 8 ++------
 3 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 9d0e6acc2e..882725d5cd 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -235,13 +235,13 @@ $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): 
%.init.o: %.o Makefile
        $(OBJCOPY) $(foreach s,$(SPECIAL_DATA_SECTIONS),--rename-section 
.$(s)=.init.$(s)) $< $@
 
 %.i: %.c Makefile
-       $(CPP) $(filter-out -Wa$(comma)%,$(CFLAGS)) $< -o $@
+       $(CPP) $(filter-out -Wa$(comma)%,$(CFLAGS)) -MQ $@ -o $@ $<
 
 %.s: %.c Makefile
        $(CC) $(filter-out -Wa$(comma)%,$(CFLAGS)) -S $< -o $@
 
 # -std=gnu{89,99} gets confused by # as an end-of-line comment marker
 %.s: %.S Makefile
-       $(CPP) $(filter-out -Wa$(comma)%,$(AFLAGS)) $< -o $@
+       $(CPP) $(filter-out -Wa$(comma)%,$(AFLAGS)) -MQ $@ -o $@ $<
 
 -include $(DEPS_INCLUDE)
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 70f532e42a..8edb200245 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -124,9 +124,7 @@ asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c
        $(CC) $(filter-out -flto,$(CFLAGS)) -S -o $@ $<
 
 xen.lds: xen.lds.S
-       $(CC) -P -E -Ui386 $(AFLAGS) -o $@ $<
-       sed -e 's/xen\.lds\.o:/xen\.lds:/g' <.xen.lds.d >.xen.lds.d.new
-       mv -f .xen.lds.d.new .xen.lds.d
+       $(CPP) -P $(AFLAGS) -MQ $@ -o $@ $<
 
 dtb.o: $(CONFIG_DTB_FILE)
 
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index a0b2f4ab15..00d7dbe51b 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -241,14 +241,10 @@ $(BASEDIR)/include/asm-x86/asm-macros.h: asm-macros.i 
Makefile
        $(call move-if-changed,$@.new,$@)
 
 xen.lds: xen.lds.S
-       $(CC) -P -E -Ui386 $(filter-out -Wa$(comma)%,$(AFLAGS)) -o $@ $<
-       sed -e 's/.*\.lds\.o:/$(@F):/g' <.$(@F).d >.$(@F).d.new
-       mv -f .$(@F).d.new .$(@F).d
+       $(CPP) -P $(filter-out -Wa$(comma)%,$(AFLAGS)) -MQ $@ -o $@ $<
 
 efi.lds: xen.lds.S
-       $(CC) -P -E -Ui386 -DEFI $(filter-out -Wa$(comma)%,$(AFLAGS)) -o $@ $<
-       sed -e 's/.*\.lds\.o:/$(@F):/g' <.$(@F).d >.$(@F).d.new
-       mv -f .$(@F).d.new .$(@F).d
+       $(CPP) -P -DEFI $(filter-out -Wa$(comma)%,$(AFLAGS)) -MQ $@ -o $@ $<
 
 boot/mkelf32: boot/mkelf32.c
        $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13



 


Rackspace

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