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

Re: [XEN PATCH v7 01/51] build: introduce cpp_flags macro


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 6 Sep 2021 12:30:07 +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; bh=Ld/f2dx1cE58n/YMzJDEy0DH6VXjkwcYdaqKpjFUdSg=; b=R1PjiE7mdimW/MIqkvFGXBxs52KySlIne9ltnszRY4jj9trvpkYO85rnhuc8x3zZBra4Gnc2pxv4zH5F0vfOAzPICGMRgs8mltWeQI80s0y0Tz9t0yCyGQqZxgGxQtAk8upLIChiREoZuvOVPMr5zcmVoDrx6vK26p5fX87JDIqhAJp71icL0dWCDWZbLSB8f3/ZiD6SwzWXdvUr6j06ngc1tNBwHQu4/i87Agc65pAr00E4ZNpgiSPDpxBcg6a49sBUlLv7UrUVElZi6FCTW5QtENf6+utHYcFUiSLt6A0NJzdaHK4+13gtWswRRTn53bXDH1wLBErFsS311LqfHQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HKLLUw5OGe9ljUCFPEp1GmutQSR6e5A1oJ6vFxbMgk67g3EUht+39Im0yr5dECSdSH7C0dmCluOojrp4Z3pQl+FqM3mKUA59Iq0+NS7eiS6IYBh7lLnboKG+g/vU/D5YU2ADztMfZ0B8IVWjOgv8DMHuS8QFijFsC+6eXO5apgOWzj7vwC5wfhM6BQureYg9r4MjElcsa0zLypfa7EdVFylar5R5vnu1dwpLHfd4B2A7wsvrjKmetmFErKMqqSe/fMtBpn7FvRXKiuOAYf2YnRrcAQdSoF5p9q1ItA4aspXKdJVPlINvoXySROIawgTm13TkSy+ZAn26bTRHGK8aIg==
  • 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>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 06 Sep 2021 10:30:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06.09.2021 12:06, Anthony PERARD wrote:
> On Thu, Sep 02, 2021 at 12:08:58PM +0200, Jan Beulich wrote:
>> On 24.08.2021 12:49, Anthony PERARD wrote:
>>> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
>>
>> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
>> albeit with a remark:
>>
>>> --- a/xen/Rules.mk
>>> +++ b/xen/Rules.mk
>>> @@ -133,6 +133,9 @@ endif
>>>  # Always build obj-bin files as binary even if they come from C source. 
>>>  $(obj-bin-y): XEN_CFLAGS := $(filter-out -flto,$(XEN_CFLAGS))
>>>  
>>> +# To be use with $(a_flags) or $(c_flags) to produce CPP flags
>>> +cpp_flags = $(filter-out -Wa$(comma)% -flto,$(1))
>>
>> Afaics this has nothing to do with Linux'es cpp_flags, so what we do here
>> is entirely up to us. If this is strictly intended to be used the another
>> macro, wouldn't it make sense to have
>>
>> cpp_flags = $(filter-out -Wa$(comma)% -flto,$($(1)))
>>
>> here and then e.g. ...
>>
>>> @@ -222,13 +225,13 @@ $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): 
>>> %.init.o: %.o FORCE
>>>     $(call if_changed,obj_init_o)
>>>  
>>>  quiet_cmd_cpp_i_c = CPP     $@
>>> -cmd_cpp_i_c = $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) -MQ $@ -o $@ $<
>>> +cmd_cpp_i_c = $(CPP) $(call cpp_flags,$(c_flags)) -MQ $@ -o $@ $<
>>
>> ... the slightly simpler / easier to read
>>
>> cmd_cpp_i_c = $(CPP) $(call cpp_flags,c_flags) -MQ $@ -o $@ $<
>>
>> here?
> 
> I don't think this is better or simpler. "cpp_flags" don't need to know
> the name of the variable to be useful. I think it is better to know that
> "cpp_flags" act on the value of the variable rather than the variable
> itself, when reading "$(call cpp_flags, $(a_flags))".

Well, yes. This way one could also pass more than just the expansion of
either of these two variables. The thing that made me think of the
alternative is the comment: Would you mind if I inserted "e.g." in there,
to make clear this isn't limited to these two variables?

Jan




 


Rackspace

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