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

Re: [Xen-devel] [PATCH] x86: fold linker script pre-processing rules



On 30.01.2020 15:47, Andrew Cooper wrote:
> On 30/01/2020 14:44, Jan Beulich wrote:
>> 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 <jbeulich@xxxxxxxx>
>>
>> --- a/xen/arch/x86/Makefile
>> +++ b/xen/arch/x86/Makefile
>> @@ -241,15 +241,12 @@ $(BASEDIR)/include/generated/config.h: F
>>      echo '#endif' >>$@.new
>>      $(call move-if-changed,$@.new,$@)
>>  
>> -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
> 
> I think it would be more natural to read with this line at the top,
> ahead of the rule:
> 
> efi.lds: AFLAGS += -DEFI
> xen.lds efi.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 ...

> Either way, Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Thanks.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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