Skip to contentSkip to conversation

x86: fix efi.lds dependency generation

PATCH Superseded Wei Liu 2 participants 2 messages Nov 18, 2018 – Nov 19, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 x86: fix efi.lds dependency generation

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.

Fix the sed rune.

---
 xen/arch/x86/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/Makefile +1 -1
index 162b0b94c0..743c12cbfa 100644
@@ -239,7 +239,7 @@ xen.lds: xen.lds.S
 
 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/xen\.lds\.o:/efi\.lds:/g' <.$(@F).d >.$(@F).d.new
 	mv -f .$(@F).d.new .$(@F).d
 
 boot/mkelf32: boot/mkelf32.c
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 18.11.18 at 14:14, <[email protected]> wrote:

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 this is a gcc bug, which I'd expect them to fix at some point. Hence I'd prefer ...

xen/arch/x86/Makefile xen.lds: xen.lds.S · line 242

Quoted 8 lines
xen/arch/x86/Makefile +1 -1
@@ -239,7 +239,7 @@ xen.lds: xen.lds.S
 
 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/xen\.lds\.o:/efi\.lds:/g' <.$(@F).d >.$(@F).d.new

... if this allowed for both the observed and the supposedly correct variants. Perhaps simply allowing for any *.lds.o as a target would be best?

Also while at it would you mind stripping the bogus / superfluous (afaict) backslash escaping the . in the replacement string, at which point $@ would imo be better to use there (or $(@F) to be consistent with the input and output redirection)? (I realize I must have been the one to not do it this way in the first place.)

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel