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

Re: [PATCH v4 1/2] xen: asm-generic support



On Wed, Sep 06, 2023 at 01:03:32PM +0000, Bertrand Marquis wrote:
> > On 6 Sep 2023, at 13:37, Oleksii <oleksii.kurochko@xxxxxxxxx> wrote:
> > On Mon, 2023-09-04 at 13:39 +0000, Bertrand Marquis wrote:
> >>> diff --git a/xen/scripts/Makefile.asm-generic
> >>> b/xen/scripts/Makefile.asm-generic
> >>> new file mode 100644
> >>> index 0000000000..0aac3f50b8
> >>> --- /dev/null
> >>> +++ b/xen/scripts/Makefile.asm-generic
> >>> +
> >>> +$(obj)/%.h:
> >>> + $(call cmd,wrap)
> >> 
> >> In fact i think your files are not generated in the srctree so this
> >> will break if you use out of tree compilation.
> > I checked that and in both cases it generated in correct place.
> > 
> > First case:
> > $ CONTAINER_NO_PULL=1 CONTAINER=riscv64
> > ./automation/scripts/containerize make XEN_TARGET_ARCH=riscv64 -C xen
> > build
> > 
> > $ ls -la xen/arch/riscv/include/generated/asm/vm_event.h 
> > -rw-r--r--. 1 ok ok 34 вер  6 14:32
> > xen/arch/riscv/include/generated/asm/vm_event.h
> > 
> > Second case: ( out-of-tree )
> > $ CONTAINER_NO_PULL=1 CONTAINER=riscv64
> > ./automation/scripts/containerize make O=xen_build
> > XEN_TARGET_ARCH=riscv64 -C xen build V=1
> > 
> > $ ls -la xen/xen_build/arch/riscv/include/generated/asm/vm_event.h 
> > -rw-r--r--. 1 ok ok 34 вер  6 14:34
> > xen/xen_build/arch/riscv/include/generated/asm/vm_event.h
> > 
> > Could you please clarify if there's somithing I might have overlooked?
> 
> No I do not think you did.
> 
> So obj is empty I would guess.
> Anyway you just need to make sure that CFLAGS is coherent with what you 
> generate.
> So if you generate in $(obj) you need to make sure you use the same in CFLAGS 
> i would say.
> 
> @anthony: any advice here ?

The use of $(obj) looks fine here. $(obj) is temporary and set for a
single subdirectory. $(obj) is set by whatever is calling
"Makefile.asm-generic", or "Rules.mk" is other cases.

In this patch, you can see $(obj) been set in "xen/Makefile":
    $(MAKE) -f $(srctree)/scripts/Makefile.asm-generic 
obj=arch/$(SRCARCH)/include/generated/asm

Another thing to know, `make` runs from the build directory, so in
Oleksii second case, `make` is running in "xen/xen_build", so $(obj) point
to a directory within the build directory.

For the CFLAGS, we can use $(objtree) (even if it is just "."), which
always point to the top directory of the build tree.

I hope that clarifies things.

Cheers,

-- 
Anthony PERARD



 


Rackspace

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