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

Re: [XEN PATCH v6 17/31] build: convert binfile use to if_changed


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 13 Jul 2021 17:33:53 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dnXGTv3FQadO8NOCbKMdMebJy20YymrXYr8MzcF5cd0=; b=k1GVdo+ecApBEQQJJyOoXgM4AlSe35HY2WiSCWtljIqSuBDh8/zH0hbqVEz2hs9L9Ys5jXaf2quJP0Ge3+rUMf1SpGixCdbSLNaorxBldy55z0o1lwOYHVmSehwPyArMVht9vUZN2gc4idIwTFdqYkWxEd77/LL3cLaom5oZtqvhsIf4na/RQN+C3jouro0AQJB8cGZue25KD0CUGakCmp3QwTcDUTi9L4WNbGeAER6bwrFouef6Gj5CSESgUlnIrZBCo/WnC3H0LYzcsSX0adxak3esXe1hD7VnQKHRB6DifoFVIebqfN1KwRTpRQid9z+49Wk/I2gY0q0tOaCt6g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fzx0kYg7WhknrZwAVzhBek/MgNLW97gvSNexEQIt2wPVUsEjkK3fa0IRbhNyih8h67Q6hodgqiq1d8CFEVlsXLitlQurG98mys4DTFpfRyXia9kgyphl9HCp2b4G/VwxRI7CMjt8IHo/piujmSut0IWl3KRL3UVvqwkN055Y4arQdcHhleEpgwYAoyxbxBV09h9TXjPBsxUrInSyNBkxN4AAagQtJHVL9xUaeBE9exjRCBEl6hz+j5uC4OEQqKXmr/Jwr3vahFXyVb30yGc1PI9xWco8IHO2xempj+0is6lR4T2Ad9iglvp2CPwxGgy3A2JD2apmkux0Ug8BdcKdLQ==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 13 Jul 2021 15:34:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.07.2021 16:58, Anthony PERARD wrote:
> On Tue, Jul 13, 2021 at 09:51:45AM +0200, Jan Beulich wrote:
>> On 12.07.2021 18:32, Anthony PERARD wrote:
>>> On Wed, Jul 07, 2021 at 05:48:57PM +0200, Jan Beulich wrote:
>>>> On 01.07.2021 16:09, Anthony PERARD wrote:
>>>>> --- a/xen/common/Makefile
>>>>> +++ b/xen/common/Makefile
>>>>> @@ -80,8 +80,12 @@ config.gz: $(CONF_FILE)
>>>>>  
>>>>>  config_data.o: config.gz
>>>>>  
>>>>> -config_data.S: $(BASEDIR)/tools/binfile
>>>>> - $(SHELL) $(BASEDIR)/tools/binfile $@ config.gz xen_config_data
>>>>> +quiet_cmd_binfile = BINFILE $@
>>>>> +cmd_binfile = $(SHELL) $< $@ config.gz xen_config_data
>>>>
>>>> This is an abuse of $< which I consider overly confusing:
>>>> $(BASEDIR)/tools/binfile is not the input file to the rule. Instead
>>>> the script generates an assembly file "out of thin air", with not
>>>> input files at all. The rule and ...
>>>>
>>>>> +config_data.S: $(BASEDIR)/tools/binfile FORCE
>>>>
>>>> ... dependency shouldn't give a different impression. What would
>>>> be nice (without having checked how difficult this might be) would
>>>> be if quiet_cmd_binfile and cmd_binfile could move to xen/Rules.mk
>>>> and merely be used from here (and the other location, where the
>>>> same concern obviously applies).
>>>
>>> I've though of having cmd_binfile in Rules.mk, but it's made more
>>> complicated by having a "-i" flag used in flask/.
>>>
>>> So one things I've writen was:
>>>
>>> config_data.S: $(BASEDIR)/tools/binfile FORCE
>>>        $(call if_changed,binfile,,config.gz xen_config_data)
>>> flask-policy.S: $(BASEDIR)/tools/binfile FORCE
>>>        $(call if_changed,binfile,-i,policy.bin xsm_flask_init_policy)
>>>
>>> with:
>>> cmd_binfile = $(SHELL) $(BASEDIR)/tools/binfile $(2) $@ $(3)
>>>
>>> I thought this would be confusing, so I avoid it.
>>
>> Indeed that's why I did write "without having checked how difficult
>> this might be", because I definitely didn't want to suggest such
>> anomalies to get introduced. It's unhelpful that options have to
>> come first.
>>
>>> But maybe with the lists of flags at the end, it would be better:
>>>    $(call if_changed,binfile,policy.bin xsm_flask_init_policy,-i)
>>
>> Yes, this is a little better imo, but still not pretty.
>>
>>> Still want to move cmd_binfile to Rules.mk?
>>
>> I'd still like it to be moved, but without resulting in a rule
>> that's not consistent with others. Maybe we should have a
>> BINFILE_FLAGS variable (paralleling e.g. CFLAGS)?
> 
> Sound good.
> 
>     cmd_binfile = $(SHELL) $(BASEDIR)/tools/binfile $(BINFILE_FLAGS) $@ $(2)
> 
>     flask-policy.S: BINFILE_FLAGS := -i
>     flask-policy.S: $(BASEDIR)/tools/binfile FORCE
>            $(call if_changed,binfile,policy.bin xsm_flask_init_policy)
> 
> Would the above be OK?
> Otherwise, maybe you'll prefer the following:
> 
>     flask-policy.S: BINFILE_FLAGS = -i $@ policy.bin xsm_flask_init_policy
>     flask-policy.S: $(BASEDIR)/tools/binfile FORCE
>            $(call if_changed,binfile)

I think I like the former better than the latter, but I could live
with either.

Jan




 


Rackspace

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