qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Zhao Liu" <zhao1.liu@intel.com>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH] stubs/meson: Fix qemuutil build when --disable-system
Date: Thu, 6 Jun 2024 09:41:47 +0200	[thread overview]
Message-ID: <a9271307-dee6-43f7-ba96-89d29310e43d@redhat.com> (raw)
In-Reply-To: <20240605152549.1795762-1-zhao1.liu@intel.com>

On 6/5/24 17:25, Zhao Liu wrote:
> Compiling without system, user, tools or guest-agent fails with the
> following error message:
> 
> ./configure --disable-system --disable-user --disable-tools \
> --disable-guest-agent
> 
> error message:
> 
> /usr/bin/ld: libqemuutil.a.p/util_error-report.c.o: in function `error_printf':
> /media/liuzhao/data/qemu-cook/build/../util/error-report.c:38: undefined reference to `error_vprintf'
> /usr/bin/ld: libqemuutil.a.p/util_error-report.c.o: in function `vreport':
> /media/liuzhao/data/qemu-cook/build/../util/error-report.c:215: undefined reference to `error_vprintf'
> collect2: error: ld returned 1 exit status
> 
> This is because tests/bench and tests/unit both need qemuutil, which
> requires error_vprintf stub when system is disabled.
> 
> Add error_vprintf stub into stub_ss for all cases other than disabling
> system.

Should be "other than enabled system emulation", but...

> -if have_ga
> -  stub_ss.add(files('error-printf.c'))
> -endif
> -
>   if have_block or have_user
>     stub_ss.add(files('qtest.c'))
>     stub_ss.add(files('vm-stop.c'))
>     stub_ss.add(files('vmstate.c'))
> -
> -  # more symbols provided by the monitor
> -  stub_ss.add(files('error-printf.c'))
>   endif

... these should be left in, since it's possible to build with 
--enable-guest-agent --enable-system.

The best and easiest solution is simply to move error-printf.c to the 
unconditional section at the top of the file.  I queued the patch with 
that change.

Paolo

>   if have_user
> @@ -76,6 +69,9 @@ if have_system
>     stub_ss.add(files('target-monitor-defs.c'))
>     stub_ss.add(files('win32-kbd-hook.c'))
>     stub_ss.add(files('xen-hw-stub.c'))
> +else
> +  # more symbols provided by the monitor
> +  stub_ss.add(files('error-printf.c'))
>   endif
>   
>   if have_system or have_user



  parent reply	other threads:[~2024-06-06  7:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-05 15:25 [PATCH] stubs/meson: Fix qemuutil build when --disable-system Zhao Liu
2024-06-06  3:18 ` Zhao Liu
2024-06-06  7:41 ` Paolo Bonzini [this message]
2024-06-06  8:03   ` Zhao Liu

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=a9271307-dee6-43f7-ba96-89d29310e43d@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=berrange@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=zhao1.liu@intel.com \
    /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).