From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxj00-0005bC-Cl for qemu-devel@nongnu.org; Thu, 19 Jun 2014 16:32:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wxizv-0000Z5-2o for qemu-devel@nongnu.org; Thu, 19 Jun 2014 16:31:56 -0400 Received: from mail-qa0-f50.google.com ([209.85.216.50]:64226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxizu-0000Z0-Ua for qemu-devel@nongnu.org; Thu, 19 Jun 2014 16:31:51 -0400 Received: by mail-qa0-f50.google.com with SMTP id m5so2379255qaj.23 for ; Thu, 19 Jun 2014 13:31:50 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20140619182409.GA22948@redhat.com> References: <20140619173410.7378.82319.stgit@3820> <20140619182409.GA22948@redhat.com> From: Nikolay Nikolaev Date: Thu, 19 Jun 2014 23:31:30 +0300 Message-ID: Content-Type: multipart/alternative; boundary=001a11c306103f935804fc3644bb Subject: Re: [Qemu-devel] [snabb-devel] Re: [PATCH v2] qtest: enable vhost-user-test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "snabb-devel@googlegroups.com" Cc: VirtualOpenSystems Technical Team , qemu-devel --001a11c306103f935804fc3644bb Content-Type: text/plain; charset=UTF-8 On Thu, Jun 19, 2014 at 9:24 PM, Michael S. Tsirkin wrote: > On Thu, Jun 19, 2014 at 08:35:42PM +0300, Nikolay Nikolaev wrote: > > Use qtest-obj-y to get the right library order. CONFIG_POSIX ensures > > mingw compilation won't break. > > > > Signed-off-by: Nikolay Nikolaev > > okay but why does non posix work without -lutil and posix doesn't? > There are 2 things here: 1. vhost-user-test links to qemu-char.o, which uses qemu_openpty_raw from libqemuutil.a. qemu_openpty_raw requires openpty from libutil. We added LIBS=-lutil in tests/Makefile to satisfy this dependency. 2. tests/Makefile is included in the main Makefile, so LIBS is applied to all make targets. Making LIBS depend on CONFIG_POSIX actually switches on/off -lutil globally. Probably the best solution would be to just stub qemu_openpty_raw an drop -lutil. regards, Nikolay Nikolaev > > > --- > > 0 files changed > > > > diff --git a/tests/Makefile b/tests/Makefile > > index 4caf7de..5661d52 100644 > > --- a/tests/Makefile > > +++ b/tests/Makefile > > @@ -156,7 +156,7 @@ gcov-files-i386-y += hw/usb/hcd-ehci.c > > gcov-files-i386-y += hw/usb/hcd-uhci.c > > gcov-files-i386-y += hw/usb/dev-hid.c > > gcov-files-i386-y += hw/usb/dev-storage.c > > -#check-qtest-i386-y += tests/vhost-user-test$(EXESUF) > > +check-qtest-i386-$(CONFIG_POSIX) += tests/vhost-user-test$(EXESUF) > > check-qtest-x86_64-y = $(check-qtest-i386-y) > > gcov-files-i386-y += i386-softmmu/hw/timer/mc146818rtc.c > > gcov-files-x86_64-y = $(subst > i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y)) > > @@ -323,11 +323,14 @@ tests/es1370-test$(EXESUF): tests/es1370-test.o > > tests/intel-hda-test$(EXESUF): tests/intel-hda-test.o > > tests/ioh3420-test$(EXESUF): tests/ioh3420-test.o > > tests/usb-hcd-ehci-test$(EXESUF): tests/usb-hcd-ehci-test.o > $(libqos-pc-obj-y) > > -tests/vhost-user-test$(EXESUF): tests/vhost-user-test.o qemu-char.o > qemu-timer.o libqemuutil.a libqemustub.a > > +tests/vhost-user-test$(EXESUF): tests/vhost-user-test.o qemu-char.o > qemu-timer.o $(qtest-obj-y) > > tests/qemu-iotests/socket_scm_helper$(EXESUF): > tests/qemu-iotests/socket_scm_helper.o > > tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o libqemuutil.a > libqemustub.a > > > > -#LIBS+= -lutil > > + > > +ifeq ($(CONFIG_POSIX),y) > > +LIBS+= -lutil > > +endif > > > > # QTest rules > > > > -- > You received this message because you are subscribed to the Google Groups > "Snabb Switch development" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to snabb-devel+unsubscribe@googlegroups.com. > To post to this group, send an email to snabb-devel@googlegroups.com. > Visit this group at http://groups.google.com/group/snabb-devel. > --001a11c306103f935804fc3644bb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



On Thu, Jun 19, 2014 at 9:24 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
okay but why does non posix work without -lutil and posix doesn't= ?

There are 2 things here:

1. vhost-user-test links to qemu-char.o, which uses qemu_openpty_raw = from libqemuutil.a.
qemu_openpty_raw requires openpty from libutil. We added LIBS=3D-lutil in t= ests/Makefile to satisfy this dependency.

2. tests/Makefile is inclu= ded in the main Makefile, so LIBS is applied to all make targets. Making LI= BS depend on CONFIG_POSIX actually switches on/off -lutil globally.

Probably the best solution would be to just stub qemu_openpt= y_raw an drop -lutil.

regards,
Nikolay Niko= laev
=C2=A0

> ---
> =C2=A00 files changed
>
> diff --git a/tests/Makefile b/tests/Makefile
> index 4caf7de..5661d52 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -156,7 +156,7 @@ gcov-files-i386-y +=3D hw/usb/hcd-ehci.c
> =C2=A0gcov-files-i386-y +=3D hw/usb/hcd-uhci.c
> =C2=A0gcov-files-i386-y +=3D hw/usb/dev-hid.c
> =C2=A0gcov-files-i386-y +=3D hw/usb/dev-storage.c
> -#check-qtest-i386-y +=3D tests/vhost-user-test$(EXESUF)
> +check-qtest-i386-$(CONFIG_POSIX) +=3D tests/vhost-user-test$(EXESUF)<= br> > =C2=A0check-qtest-x86_64-y =3D $(check-qtest-i386-y)
> =C2=A0gcov-files-i386-y +=3D i386-softmmu/hw/timer/mc146818rtc.c
> =C2=A0gcov-files-x86_64-y =3D $(subst i386-softmmu/,x86_64-softmmu/,$(= gcov-files-i386-y))
> @@ -323,11 +323,14 @@ tests/es1370-test$(EXESUF): tests/es1370-test.o<= br> > =C2=A0tests/intel-hda-test$(EXESUF): tests/intel-hda-test.o
> =C2=A0tests/ioh3420-test$(EXESUF): tests/ioh3420-test.o
> =C2=A0tests/usb-hcd-ehci-test$(EXESUF): tests/usb-hcd-ehci-test.o $(li= bqos-pc-obj-y)
> -tests/vhost-user-test$(EXESUF): tests/vhost-user-test.o qemu-char.o q= emu-timer.o libqemuutil.a libqemustub.a
> +tests/vhost-user-test$(EXESUF): tests/vhost-user-test.o qemu-char.o q= emu-timer.o $(qtest-obj-y)
> =C2=A0tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotest= s/socket_scm_helper.o
> =C2=A0tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o libqemuuti= l.a libqemustub.a
>
> -#LIBS+=3D -lutil
> +
> +ifeq ($(CONFIG_POSIX),y)
> +LIBS+=3D -lutil
> +endif
>
> =C2=A0# QTest rules
>

--
You received this message because you are subscribed to the Google Groups &= quot;Snabb Switch development" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to snabb-devel+unsubscribe@googlegroups.com.
To post to this group, send an email to snabb-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/snabb-devel.

--001a11c306103f935804fc3644bb--