Message ID | 20240605152549.1795762-1-zhao1.liu@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | stubs/meson: Fix qemuutil build when --disable-system | expand |
On Wed, Jun 05, 2024 at 11:25:49PM +0800, Zhao Liu wrote: > Date: Wed, 5 Jun 2024 23:25:49 +0800 > From: Zhao Liu <zhao1.liu@intel.com> > Subject: [PATCH] stubs/meson: Fix qemuutil build when --disable-system > X-Mailer: git-send-email 2.34.1 > > 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. > > Fixes: 3a15604900c4 ("stubs: include stubs only if needed") > Reported-by: Daniel P. Berrangé <berrange@redhat.com> > Signed-off-by: Zhao Liu <zhao1.liu@intel.com> > --- > stubs/meson.build | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/stubs/meson.build b/stubs/meson.build > index 3b9d42023cb2..a99522ab6bbf 100644 > --- a/stubs/meson.build > +++ b/stubs/meson.build > @@ -45,17 +45,10 @@ if have_block or have_ga > stub_ss.add(files('qmp-quit.c')) > endif > > -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 > > 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 Oops, it's not a correct fix. error-printf.c should still be added unconditionally. > > if have_system or have_user > -- > 2.34.1 >
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
On Thu, Jun 06, 2024 at 09:41:47AM +0200, Paolo Bonzini wrote: > Date: Thu, 6 Jun 2024 09:41:47 +0200 > From: Paolo Bonzini <pbonzini@redhat.com> > Subject: Re: [PATCH] stubs/meson: Fix qemuutil build when --disable-system > > 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. Thanks!! I can delete my v2 branch now. :-)
diff --git a/stubs/meson.build b/stubs/meson.build index 3b9d42023cb2..a99522ab6bbf 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -45,17 +45,10 @@ if have_block or have_ga stub_ss.add(files('qmp-quit.c')) endif -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 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
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. Fixes: 3a15604900c4 ("stubs: include stubs only if needed") Reported-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Zhao Liu <zhao1.liu@intel.com> --- stubs/meson.build | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)