x86: fold linker script pre-processing rules
PATCH 1/1 x86: fold linker script pre-processing rules
There's no need to have twice almost the same rule. Simply add the extra -DEFI to AFLAGS for the EFI variant, and specify both targets for the then single rule.
xen/arch/x86/Makefile +2 -5
@@ -241,15 +241,12 @@ $(BASEDIR)/include/generated/config.h: F echo '#endif' >>[email protected] $(call move-if-changed,[email protected],$@) -xen.lds: xen.lds.S +xen.lds efi.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 -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 +efi.lds: AFLAGS += -DEFI boot/mkelf32: boot/mkelf32.c $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 13 lines · Jan Beulich
There's no need to have twice almost the same rule. Simply add the extra -DEFI to AFLAGS for the EFI variant, and specify both targets for the then single rule.
Signed-off-by Jan Beulich <[email protected]>xen/arch/x86/Makefile +0
-1@@ -241,15 +241,12 @@ $(BASEDIR)/include/generated/config.h: F echo '#endif' >>[email protected] $(call move-if-changed,[email protected],$@) -xen.lds: xen.lds.S
xen/arch/x86/Makefile $(BASEDIR)/include/generated/config.h: F · line 249
Quoted 10 lines
xen/arch/x86/Makefile +2
-4+xen.lds efi.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 -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 +efi.lds: AFLAGS += -DEFI
I think it would be more natural to read with this line at the top, ahead of the rule:
efi.lds: AFLAGS += -DEFIxen.lds efi.lds: xen.lds.S
...
Either way, Acked-by: Andrew Cooper <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 28 lines · Andrew Cooper
Quoted 13 lines · Jan Beulich
There's no need to have twice almost the same rule. Simply add the extra -DEFI to AFLAGS for the EFI variant, and specify both targets for the then single rule.
Signed-off-by Jan Beulich <[email protected]>xen/arch/x86/Makefile +0
-1@@ -241,15 +241,12 @@ $(BASEDIR)/include/generated/config.h: F echo '#endif' >>[email protected] $(call move-if-changed,[email protected],$@) -xen.lds: xen.lds.Sxen/arch/x86/Makefile $(BASEDIR)/include/generated/config.h: F · line 249
Quoted 10 lines
xen/arch/x86/Makefile +2
-4+xen.lds efi.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 -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 +efi.lds: AFLAGS += -DEFII think it would be more natural to read with this line at the top, ahead of the rule:
Quoted 3 lines
efi.lds: AFLAGS += -DEFIxen.ldsefi.lds:xen.lds.S
...
In fact I first wanted to do it this way, then thought the EFI special case shouldn't come earlier than the general one. But since you ask for it ...
Quoted 1 line
Either way, Acked-by: Andrew Cooper <[email protected]>
Thanks.
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 5 lines · Jan Beulich
There's no need to have twice almost the same rule. Simply add the extra -DEFI to AFLAGS for the EFI variant, and specify both targets for the then single rule.
Signed-off-by Jan Beulich <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel