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

[xen staging] x86/build: limit rebuilding of asm-offsets.h



commit 7d2d7a43d0141de69d837854ce139bcd47a7b859
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Jan 5 13:12:15 2021 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Jan 5 13:12:15 2021 +0100

    x86/build: limit rebuilding of asm-offsets.h
    
    This file has a long dependencies list (through asm-offsets.[cs]) and a
    long list of dependents. IOW if any of the former changes, all of the
    latter will be rebuilt, even if there's no actual change to the
    generated file. This is the primary scenario we have the move-if-changed
    macro for.
    
    Since debug information may easily cause the file contents to change in
    benign ways, also avoid emitting this into the output file.
    
    Finally already before this change *.new files needed including in what
    gets removed by the "clean" target.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 863aed043f..7f4f5ed96f 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -241,7 +241,8 @@ efi/buildid.o efi/relocs-dummy.o: 
$(BASEDIR)/arch/x86/efi/built_in.o
 efi/buildid.o efi/relocs-dummy.o: ;
 
 asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c 
$(BASEDIR)/include/asm-x86/asm-macros.h
-       $(CC) $(filter-out -Wa$(comma)% -flto,$(c_flags)) -S -o $@ $<
+       $(CC) $(filter-out -Wa$(comma)% -flto,$(c_flags)) -S -g0 -o $@.new $<
+       $(call move-if-changed,$@.new,$@)
 
 asm-macros.i: CFLAGS-y += -D__ASSEMBLY__ -P
 
@@ -268,7 +269,7 @@ efi/mkreloc: efi/mkreloc.c
 
 .PHONY: clean
 clean::
-       rm -f asm-offsets.s *.lds boot/*.o boot/*~ boot/core boot/mkelf32
+       rm -f asm-offsets.s *.lds *.new boot/*.o boot/*~ boot/core boot/mkelf32
        rm -f asm-macros.i $(BASEDIR)/include/asm-x86/asm-macros.*
        rm -f $(BASEDIR)/.xen-syms.[0-9]* boot/.*.d $(BASEDIR)/.xen.elf32
        rm -f $(BASEDIR)/.xen.efi.[0-9]* efi/*.efi efi/mkreloc
--
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®.