]> xenbits.xensource.com Git - people/pauldu/xen.git/commitdiff
x86: fix efi.lds dependency generation
authorWei Liu <wei.liu2@citrix.com>
Fri, 16 Nov 2018 18:58:55 +0000 (18:58 +0000)
committerWei Liu <wei.liu2@citrix.com>
Mon, 19 Nov 2018 11:09:51 +0000 (11:09 +0000)
RANDCONFIG builds discover efi.lds is not updated when autogenerated
headers are updated.

Upon inspection, the generated .d file contains xen.lds.o as target,
not the once thought efi.lds.o. That's because gcc disregards the
output object name specified by -o when generating dependency, so the
sed invocation has no effect.

Arguably that's a bug in gcc, which can be fixed at some point, so we
make the sed rune work with *.lds. At the same time replace the
hardcoded sed rune for xen.lds with the new one.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/Makefile

index 162b0b94c05c32cb5436dd006501a03845459359..484dcb7ce791bf3d569d1a7725ba9fd8e12e3c59 100644 (file)
@@ -234,12 +234,12 @@ $(BASEDIR)/include/asm-x86/asm-macros.h: asm-macros.i Makefile
 
 xen.lds: xen.lds.S
        $(CC) -P -E -Ui386 $(filter-out -Wa$(comma)%,$(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
+       sed -e 's/.*\.lds\.o:/$(@F):/g' <.$(@F).d >.$(@F).d.new
+       mv -f .$(@F).d.new .$(@F).d
 
 efi.lds: xen.lds.S
        $(CC) -P -E -Ui386 -DEFI $(filter-out -Wa$(comma)%,$(AFLAGS)) -o $@ $<
-       sed -e 's/efi\.lds\.o:/efi\.lds:/g' <.$(@F).d >.$(@F).d.new
+       sed -e 's/.*\.lds\.o:/$(@F):/g' <.$(@F).d >.$(@F).d.new
        mv -f .$(@F).d.new .$(@F).d
 
 boot/mkelf32: boot/mkelf32.c