[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN PATCH 1/3] build: define ARCH and SRCARCH later
- To: Anthony PERARD <anthony.perard@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Wed, 21 Jun 2023 17:25:17 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=oinz2MmQLLGY2TKud7kQ6TRCvvfk435fyeKQJQt7zKU=; b=WS7/KwPNpBUiIn07zgknQJmYzofQHkj/jmEyYQckO1WaGjVq10BtW6/xFfSoflylDqUqcxE64FElifTpwIHlycZxqFnUK0Zha8eWyDe/gtgsYvwZr6/OFuDzFAxtg/V2INRZvSho/DUqmUze4tx/dHBmERHVZDzI+YlN6jD9fFWO238H8Rxi9uyFL4Nd7oGBKL0JOORQqNLpKfDQDJXebOqvbP5mYvqAiZFb3v6XN3BSFadx9OTYtYAUvyb0q2f1PSTQHQbwEpGcfQLitWtTVNGiHTZUxqc5wN4zO5LRsnJdw6wyaMpLeE8zhp/Xdlifa4q001PSBu8sS0MVhehvcg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DINuZqpWb03PAcT1bIovAJqk9Ji8bewqB3N6CYyXEZC8gSgBBE+cs4yoISEPRh0LzdqCR4Mc1irfSaWHMBBd7dayxsFlwUFy8S2H65RkC92fyNq7w9MVI8C4Ils0I953ul9l95+GRdQx5497PDtAGCnOlGYYJxpwxsYnti673538/UtYcOKGrTqHqqN/LroLhNhrhfeAigCMFltGy5XURZL1TBkn4+xEOVWMTxMVwGMP8Q2GyxZayy23UmlvOTHWiGMd1EpMTDW3bd1xVCPMov6QGv4Q5cRGvdGwnqVjk3gk4fIi8FXpycLioZVefvEEsUqm6n+h/43FWPSZmk3R8w==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Jason Andryuk <jandryuk@xxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Wed, 21 Jun 2023 16:25:44 +0000
- Ironport-data: A9a23:fLNjdK88gFXdHIW7XryIDrUDYX+TJUtcMsCJ2f8bNWPcYEJGY0x3m 2pNDDiOb/rfYzT1fd5+Pdy28E0HsMPVzNZhQQBl+C88E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ird7ks31BjOkGlA5AdmO6oS5AO2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklM1 bsXJ2hdLSuKuOedyrCWUvlSn8kseZyD0IM34hmMzBn/JNN/GdXmfP+P4tVVmjAtmspJAPDSI dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTWOilUpjtABM/KMEjCObexTklyVu STt+GPhDwtBHNee1SCE4jSngeqncSbTAdtJSebjqqEw6LGV7kwiDEAKRVCZnaKgoG6jWIpiE UUP9DV7+MDe82TuFLERRSaQsHOC+xIRRddUO+k78x2WjLrZ5R6DAWoJRSIHb8Yp3Oc0TDomz E6UnPvmADVutPueTnf13rWeoC62OCMVBXQffiJCRgwAi/HhvYUygxTnXttlVqmvgbXdAirsy jqHqCw/gbQ7jsMR0ai/u1fdjFqEuZzhXgMzoALNUQqYAhhRYYekY8mt9gLd5PMZdIKBFADZ4 j4DhtSU6/0IAdeVjiuRTe4RHbavofGYLDnbhl0pFJ4kn9iwx0OekUlryGkWDC9U3gwsI1cFv Ge7Vdtt2aJu
- Ironport-hdrordr: A9a23:9mAnqq8aQybDFNn1y89uk+AcI+orL9Y04lQ7vn2ZKSY5TiX4rb HKoB1/73XJYVkqN03I9ervBEDiewK/yXcW2+ks1N6ZNWGLhILBFupfBODZsl7d8kPFl9K01c 1bAtJD4N+bNykGsS4tijPIb+rJw7O8gd+Vbf+19QYIcenzAZsQlzuQDGygYypLbTgDP7UVPr yG6PFKojKxEE5nFfhSVhE+Lo7+T8SgruOeXSI7
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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?
~Andrew
|