Re: [PATCH kvmtool 1/4] Makefile: Add missing build dependencies

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

 



Hi,

On Fri, Jul 22, 2022 at 03:17:29PM +0100, Jean-Philippe Brucker wrote:
> When running kvmtool after updating without doing a make clean, one
> might run into strange issues such as:
> 
>   Warning: Failed init: symbol_init
>   Fatal: Initialisation failed
> 
> or worse. This happens because symbol.o is not automatically rebuilt
> after a change of headers, because .symbol.o.d is not in the $(DEPS)
> variable. So if the layout of struct kvm_config changes, for example,
> symbols.o that was built for an older version will try to read
> kvm->vmlinux from the wrong location in struct kvm, and lkvm will die.
> 
> Add all .d files to $(DEPS). Also include $(STATIC_DEPS) which was
> previously set but not used.

This makes sense to me. And hopefully it should fix some weird errors that
went away for me by doing a make clean before a rebuild.

> 
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@xxxxxxxxxx>
> ---
>  Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 1f9903d8..f0df76f4 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -383,7 +383,7 @@ comma = ,
>  # The dependency file for the current target
>  depfile = $(subst $(comma),_,$(dir $@).$(notdir $@).d)
>  
> -DEPS	:= $(foreach obj,$(OBJS),\
> +DEPS	:= $(foreach obj,$(OBJS) $(OBJS_DYNOPT) $(OTHEROBJS) $(GUEST_OBJS),\

Checked and those are indeed all the objects.

>  		$(subst $(comma),_,$(dir $(obj)).$(notdir $(obj)).d))
>  
>  DEFINES	+= -D_FILE_OFFSET_BITS=64
> @@ -590,6 +590,7 @@ cscope:
>  # Escape redundant work on cleaning up
>  ifneq ($(MAKECMDGOALS),clean)
>  -include $(DEPS)
> +-include $(STATIC_DEPS)

In the spirit in keeping the makefile as small as possible and reading
fewer files, maybe STATIC_DEPS should be included only if the target is
$(PROGRAM)-static.

Regardless of how you want to handle that, the patch looks correct to me:

Reviewed-by: Alexandru Elisei <alexandru.elisei@xxxxxxx>

Thanks,
Alex

>  
>  KVMTOOLS-VERSION-FILE:
>  	@$(SHELL_PATH) util/KVMTOOLS-VERSION-GEN $(OUTPUT)
> -- 
> 2.37.1
> 



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux