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

Re: [XEN PATCH 1/3] build: define ARCH and SRCARCH later


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 22 Jun 2023 10:15:42 +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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Eg0nJrcVbuxTVtvD1KesIjeAKMEADEIssyGnJkmt4OY=; b=Pssez+T/xLEsnx8Ro04KIJlg+p1KwHV+SxIN/Dfphgoan3Dqg0tfzj7GjKgQJOm34EC5+zlo2pSUskrZGMaBqnuTs/pX07VBTO3uNMh06ibltYxjKyGqvEhgZYs6t33oMZIvC+rW6FWuL6vXK8zOQEGl62IIshSG4M54zRIuO1ja1PN6Hs10R9HgfKXlq47cWLVAcQdQPsYD5XGAXHZMlQyp6K9VSf6KNsh4mNZaoIWljF247ixRVcG7HAL7o5pMsARTjpYH4ql7RdM5pQomExibKEEag0R/8sPNBnE0B0PPaxf/TuarmnEdsKsl9WL9Q6nhR1ycg3FUdjuqcOAong==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JD/4+ZINEeKqyOHL8OgxCsPvrA2P1+uesXva83EM5p53Mr5lDLbpjCNe29JwXwxg3MsYM6BIVtO8Auz5QbqNvnODtXPHPk7mHsONo+MvM+ZQng0GofPIyaJMtP2vgCHVHg4LWZ/INLnaxXg8UvloUV4RZ+c269ZvLePRnhp6M5lehTuuAr9tPQdzSZZK/JZWd/DdAZ4OGEzbYydOSxQJ8/M1nHB/AY90q20CL3O64/xyW0u4fQaeksntW8r7Y/36+m0Lkfuy8bFswAubky4XImAPNzV0Zke+nQ1Zw6dkN03PSw0EKkAxnoFBMNLM1AlkXdRezMENm8tffYdHHocz4A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Jason Andryuk <jandryuk@xxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 22 Jun 2023 08:15:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21.06.2023 18:25, Andrew Cooper wrote:
> On 21/06/2023 5:19 pm, Anthony PERARD wrote:
>> Defining ARCH and SRCARCH later in xen/Makefile allows to switch to
>> immediate evaluation variable type.
>>
>> ARCH and SRCARCH depends on value defined in Config.mk and aren't used
>> TARGET_SUBARCH or TARGET_ARCH, and not before it's needed in a
>> sub-make or a rule.
>>
>> This will help reduce the number of times the shell rune is been
>> run.
>>
>> With GNU make 4.4, the number of execution of the command present in
>> these $(shell ) increased greatly. This is probably because as of make
>> 4.4, exported variable are also added to the environment of $(shell )
>> construct.
>>
>> Also, `make -d` shows a lot of these:
>>     Makefile:39: not recursively expanding SRCARCH to export to shell 
>> function
>>     Makefile:38: not recursively expanding ARCH to export to shell function
>>
>> Reported-by: Jason Andryuk <jandryuk@xxxxxxxxx>
>> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
>> ---
>>  xen/Makefile | 13 +++++++------
>>  1 file changed, 7 insertions(+), 6 deletions(-)
>>
>> diff --git a/xen/Makefile b/xen/Makefile
>> index e89fc461fc4b..9631e45cfb9b 100644
>> --- a/xen/Makefile
>> +++ b/xen/Makefile
>> @@ -35,12 +35,6 @@ MAKEFLAGS += -rR
>>  
>>  EFI_MOUNTPOINT ?= $(BOOT_DIR)/efi
>>  
>> -ARCH=$(XEN_TARGET_ARCH)
>> -SRCARCH=$(shell echo $(ARCH) | \
>> -          sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g' \
>> -              -e s'/riscv.*/riscv/g')
>> -export ARCH SRCARCH
>> -
>>  # Allow someone to change their config file
>>  export KCONFIG_CONFIG ?= .config
>>  
>> @@ -241,6 +235,13 @@ include scripts/Kbuild.include
>>  include $(XEN_ROOT)/Config.mk
>>  
>>  # Set ARCH/SUBARCH appropriately.
>> +
>> +ARCH := $(XEN_TARGET_ARCH)
>> +SRCARCH := $(shell echo $(ARCH) | \
>> +          sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g' \
>> +              -e s'/riscv.*/riscv/g')
>> +export ARCH SRCARCH
>> +
>>  export TARGET_SUBARCH  := $(XEN_TARGET_ARCH)
>>  export TARGET_ARCH     := $(shell echo $(XEN_TARGET_ARCH) | \
>>                              sed -e 's/x86.*/x86/' -e 
>> s'/arm\(32\|64\)/arm/g' \
> 
> The change looks plausible to fix this issue, but could we take the
> opportunity to dedup the sed expression into a $(call src-arch ...) or so ?
> 
> Except, given that ARCH := $(XEN_TARGET_ARCH) now, doesn't that mean
> SRCARCH is always TARGET_ARCH ?
> 
> Can't we simplify this to just be plain aliases?

Or, putting it differently, do we actually need both TARGET_* values
when they match other (exported) variables anyway?

Jan



 


Rackspace

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