[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Thu, 16 Dec 2021 11:08:42 +0000
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • 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: Thu, 16 Dec 2021 11:08:58 +0000
  • Ironport-data: A9a23:YsAfQamf81pnD1qs0HXUvnzo5gxVIERdPkR7XQ2eYbSJt1+Wr1Gzt xIZWG2GO66PYWuhfdp0O4vloB4Eu8LdnIc2Hlc6qSo0RSMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BClVlxJVF/fngqoDUUYYoAQgsA180IMsdoUg7wbdg2Nc22YLR7z6l4 rseneWOYDdJ5BYsWo4kw/rrRMRH5amaVJsw5zTSVNgT1LPsvyB94KE3fMldG0DQUIhMdtNWc s6YpF2PEsE1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u4JyiBKKvbE6AoLKAcD/A
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, Dec 07, 2021 at 12:10:34PM +0100, Jan Beulich wrote:
> 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.

I guess that would be fine, we don't need to keep the same spelling that
Kbuild does.

> > --- 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?

I think since patch 4 "build: set XEN_BUILD_EFI earlier". I'll remove
these there then.

Thanks,

-- 
Anthony PERARD



 


Rackspace

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