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

Re: [XEN PATCH 12/15] build: avoid Config.mk's CFLAGS


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 25 May 2023 14:41:31 +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=/byRGCDO8LzARuzkYb9wlOh+PDPQHqVhTGXLw4lF+qg=; b=EBlQG3xqw89DvfPgYd4WwNq016EpwmWWO+iDZt3Ns17hG824jJ8p/ef5pxmMmBlydJPRx0/Meug5m9WUlK+QiYd9RpDEZNb+wUElsXyIha/YvzGB47NADM1PAPGkx9Z9pwEJh52tWcU+ihz6mjsUl1oUi/dCA9ZUF0ctrdLhAvdBrkZfv3MY6FSLq4N727BCU2OcT0e+EwAKzSgHG/u6MmaBL6gOPVGShkwU4xFpbZsqZydlPXjxaRajY5rDFGIR4yHfTz7NkMldU+Vgs9y+KmQtxoKwNz3+b4DBJd+a9JoX0xm5JcAUuZaunJEMGMTt8M+gInz2MAZMqQ0L+f5Nuw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DB8avvGHhgigVOD0qvuktE21DXIQg0fRZE+nP7TswJfbi73AeDjTFylgp6JQ3xSFS4u/LHrO72yvPpxJF1eBQP7xupRklBDco1NB3OYSN+xWaeF5ZwlDKrj7oEd+SYHbUzpMjhcEIrqoSWLq+EDj8I2vZnMdweMEkh4UtGou/LFKLbgR+nI56TgqLVZVYB1PQdZgYYRRDEmDpwW4cgvyW/jfVkqT5REwAhPSO1uFOiQTnVl3bdfIehxIVKRk9FESv7IxI922dZ7N1yClCX7/KoYhMjgK7e85gdhiqVIuIHhh5E2Sld1rIWmkrXvuNKDfE5e7vP7+ZxfqDT7cZ0DcDg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 25 May 2023 12:41:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 23.05.2023 18:38, Anthony PERARD wrote:
> The variable $(CFLAGS) is too often set in the environment,
> especially when building a package for a distribution. Often, those
> CFLAGS are intended to be use to build user spaces binaries, not a
> kernel. This mean packager needs to takes extra steps to build Xen by
> overriding the CFLAGS provided by the package build environment.
> 
> With this patch, we avoid using the variable $(CFLAGS). Also, the
> hypervisor's build system have complete control over which CFLAGS are
> used.

"..., apart from $(EXTRA_CFLAGS_XEN_CORE)", as you say ...

> No change intended to XEN_CFLAGS used, beside some flags which may be
> in a different order on the command line.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> ---
> 
> Notes:
>     There's still $(EXTRA_CFLAGS_XEN_CORE) which allows to add more CFLAGS
>     if someone building Xen needs to add more CFLAGS to the hypervisor
>     build.

... only here.

> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -259,7 +259,16 @@ export KBUILD_DEFCONFIG := $(ARCH)_defconfig
>  export XEN_TREEWIDE_CFLAGS := $(CFLAGS)
>  
>  XEN_AFLAGS =
> -XEN_CFLAGS = $(CFLAGS)
> +XEN_CFLAGS =
> +ifeq ($(XEN_OS),SunOS)
> +    XEN_CFLAGS +=  -Wa,--divide -D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__

So this (and the arch.mk additions) duplicate stuff we have in config/*.mk.
Such duplication isn't really nice. Setting AS, CC, etc also happens there,
and hence I expect you're going to duplicate that as well in a later patch.
Can't we massage (if necessary) the config/*.mk relevant to the hypervisor
build, so they can be included from xen/Makefile? That way all such basic
settings could remain in a central place, which has been well known for
many years.

Jan



 


Rackspace

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