kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandru Elisei <alexandru.elisei@arm.com>
To: Jean-Philippe Brucker <jean-philippe@linaro.org>
Cc: will@kernel.org, kvm@vger.kernel.org, suzuki.poulose@arm.com,
	sami.mujawar@arm.com
Subject: Re: [PATCH kvmtool 1/4] Makefile: Add missing build dependencies
Date: Mon, 25 Jul 2022 11:26:15 +0100	[thread overview]
Message-ID: <Yt5vrPljvE0lMHPX@monolith.localdoman> (raw)
In-Reply-To: <20220722141731.64039-2-jean-philippe@linaro.org>

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@linaro.org>
> ---
>  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@arm.com>

Thanks,
Alex

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

  reply	other threads:[~2022-07-25 10:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-22 14:17 [PATCH kvmtool 0/4] Makefile and virtio fixes Jean-Philippe Brucker
2022-07-22 14:17 ` [PATCH kvmtool 1/4] Makefile: Add missing build dependencies Jean-Philippe Brucker
2022-07-25 10:26   ` Alexandru Elisei [this message]
2022-08-09  9:52     ` Jean-Philippe Brucker
2022-07-22 14:17 ` [PATCH kvmtool 2/4] Makefile: Fix ARCH override Jean-Philippe Brucker
2022-07-25 11:06   ` Alexandru Elisei
2022-08-09  9:56     ` Jean-Philippe Brucker
2022-08-09 15:38       ` Alexandru Elisei
2022-07-22 14:17 ` [PATCH kvmtool 3/4] virtio/pci: Deassert IRQ line on ISR read Jean-Philippe Brucker
2022-07-22 14:17 ` [PATCH kvmtool 4/4] virtio/rng: Zero-initialize the device Jean-Philippe Brucker
2022-08-04 15:02 ` [PATCH kvmtool 0/4] Makefile and virtio fixes Will Deacon
2022-08-09 10:05   ` Jean-Philippe Brucker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yt5vrPljvE0lMHPX@monolith.localdoman \
    --to=alexandru.elisei@arm.com \
    --cc=jean-philippe@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=sami.mujawar@arm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).