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

Re: [XEN PATCH v8 12/47] build: build everything from the root dir, use obj=$subdir


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 7 Dec 2021 12:10:34 +0100
  • 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=UkGzC1LW1LA9UOGe7ajsRQ7HLHHe0kpj8Wpyyc5+5pM=; b=gCon0ntCMvqJf9j3BfdkY2XZDShVuCC/RbhR9o4RNgwffAuq68cISSZMP9Db5orFBFphILUhk4YZwtbKcs98I4ICUPFfJSvS7+CoOHnhyBGEUDTn95Ky5830jzNplHMD9ALfl1S/Fyn2cImrRvMbsFajWWaR3WlCqeveI2JlIE5xzgHj8qWk2IerIgVDZqty461H59vtgyOc+h8/Td5iomrgOapz5aN6LmWEp60isW2yppsRhawFgtTmdLRWiVByBd/poxpS0JtnYVgiB03+I9jtopMBPGy6zJzwazeA7M9NHPvDRtiO4mHMeIV9mQEhCujQQa7L3wy/OTNaaBtwSw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oBxRv/QA2rnHruMoIJfz7I9jeVoSp0c+jJiy6CBPrrN9Q3pVyU7t5U6vE5rOs1L3ML1xmJjopfGJi3m+khoKKIUhKxge38figIcQmVmtemw4Y6xm30jbW9svXEmQxe9OOkoSnz3/v+DqEMdUzJxwcUhbnw+auCDKtMZlay0IB2H2FTuJflnDuoqZnwCK+jvRvGmZ52K29u2OORsiqynfgXtloIIWfllRfATX1OBYZJyk/zKjO0d0HzqMbEkFKtyMGhECrRn7SB2tLqf1/AL//xivUS7eoqIV+WSN7R+EUAbsUef5Mwsz+NwwUav3De/ECF53JEvlbwShMi2Bf28odg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Bob Eshleman <bobbyeshleman@xxxxxxxxx>, 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>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 07 Dec 2021 11:10:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 25.11.2021 14:39, Anthony PERARD wrote:
> A subdirectory is now built by setting "$(obj)" instead of changing
> directory. "$(obj)" should always be set when using "Rules.mk" and
> thus a shortcut "$(build)" is introduced and should be used.
> 
> A new variable "$(need-builtin)" is introduce. It is to be used
> whenever a "built_in.o" is wanted from a subdirectory. "built_in.o"
> isn't the main target anymore, and thus only needs to depends on the
> objects that should be part of "built_in.o".
> 
> Introduce $(srctree) and $(objtree) to replace $(BASEDIR) in cases a
> relative path is better, and $(abs_srctree) and $(abs_objtree) which
> have an absolute path.
> 
> DEPS is updated as the existing macro to deal with it doesn't know
> about $(obj).
> 
> There's some changes in "Rules.mk" which in addition to deal with
> "$(obj)" also make it's looks more like "Makefile.build" from Linux
> v5.12.
> 
> test/Makefile doesn't need special handling in order to build
> everything under test/, Rules.mk will visit test/livepatch via
> $(subdir-y), thus "tests" "all" and "build" target are removed.
> "subtree-force-update" target isn't useful so it is removed as well.
> 
> test/livepatch/Makefile doesn't need default target anymore, Rules.mk
> will build everything in $(extra-y) and thus all *.livepatch.
> 
> Adjust cloc recipe: dependency files generated by CC will now have the
> full path to the source file, so we don't need to prepend the
> subdirectory. This fix some issue with source not been parsed by cloc
> before. Also source from tools/kconfig would be listed with changes in
> this patch so adjust the find command to stop listing the "tools"
> directory and thus kconfig. With a default build of Xen on X86, they
> are a few new files parsed by cloc:
>     arch/x86/x86_64/compat/mm.c
>     arch/x86/x86_64/mm.c
>     common/compat/domain.c
>     common/compat/memory.c
>     common/compat/xlat.c
> 
> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> Acked-by: Bob Eshleman <bobbyeshleman@xxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
with one nit and a remark:

> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -22,6 +22,15 @@ export CHECKPOLICY ?= checkpolicy
>  export BASEDIR := $(CURDIR)
>  export XEN_ROOT := $(BASEDIR)/..
>  
> +abs_objtree := $(CURDIR)
> +abs_srctree := $(CURDIR)

Nit: In line with e.g. obj-y I think these would better be abs-srctree and
abs-objtree.

> --- a/xen/arch/x86/Makefile
> +++ b/xen/arch/x86/Makefile
> @@ -80,6 +80,9 @@ endif
>  extra-y += asm-macros.i
>  extra-y += xen.lds
>  
> +# Allows usercopy.c to include itself
> +$(obj)/usercopy.o: CFLAGS-y += -iquote .
> +
>  ifneq ($(CONFIG_HVM),y)
>  $(obj)/x86_emulate.o: CFLAGS-y += -Wno-unused-label
>  endif
> @@ -129,13 +132,13 @@ $(TARGET)-syms: $(BASEDIR)/prelink.o $(obj)/xen.lds
>       $(NM) -pa --format=sysv $(@D)/.$(@F).0 \
>               | $(BASEDIR)/tools/symbols $(all_symbols) --sysv --sort \
>               >$(@D)/.$(@F).0.S
> -     $(MAKE) -f $(BASEDIR)/Rules.mk efi-y= $(@D)/.$(@F).0.o
> +     $(MAKE) $(build)=$(@D) efi-y= $(@D)/.$(@F).0.o

Hmm, hasn't the efi-y= become unnecessary already by patch 6?

Jan




 


Rackspace

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