Hi Oleksii,

> On 6 Sep 2023, at 13:37, Oleksii <[email protected]> wrote:
> 
> Hello Bertrand
> 
> 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
>>> @@ -0,0 +1,23 @@
>>> +# SPDX-License-Identifier: GPL-2.0
>>> +# include/asm-generic contains a lot of files that are used
>>> +# verbatim by several architectures.
>>> +#
>>> +# This Makefile reads the file arch/$(SRCARCH)/include/asm/Kbuild
>>> +# and for each file listed in this file with generic-y creates
>>> +# a small wrapper file in $(obj)
>>> (arch/$(SRCARCH)/include/generated/asm)
>>> +
>>> +kbuild-file := $(srctree)/arch/$(SRCARCH)/include/asm/Kbuild
>>> +include $(kbuild-file)
>>> +
>>> +include scripts/Kbuild.include
>>> +
>>> +# Create output directory if not already present
>>> +_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
>>> +
>>> +quiet_cmd_wrap = WRAP    $@
>>> +cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@
>>> +
>>> +all: $(patsubst %, $(obj)/%, $(generic-y))
>>> +
>>> +$(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 ?

Cheers
Bertrand



> 
> ~ Oleksii
> 
> 
> 

Reply via email to