diff mbox

tests: Do not include lutil on SunOS

Message ID 20170903164952.26760-1-n54@gmx.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kamil Rytarowski Sept. 3, 2017, 4:49 p.m. UTC
This fixes build on SmartOS (Joyent).

Patch cherry-picked from pkgsrc by jperkin (Joyent).

Signed-off-by: Kamil Rytarowski <n54@gmx.com>
---
 tests/Makefile.include | 2 ++
 1 file changed, 2 insertions(+)

Comments

Peter Maydell Sept. 4, 2017, 9:32 a.m. UTC | #1
On 3 September 2017 at 17:49, Kamil Rytarowski <n54@gmx.com> wrote:
> This fixes build on SmartOS (Joyent).
>
> Patch cherry-picked from pkgsrc by jperkin (Joyent).
>
> Signed-off-by: Kamil Rytarowski <n54@gmx.com>
> ---
>  tests/Makefile.include | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index f08b7418f0..0e5e6cb9b8 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -810,8 +810,10 @@ tests/migration/initrd-stress.img: tests/migration/stress$(EXESUF)
>         rmdir $(INITRD_WORK_DIR)
>
>  ifeq ($(CONFIG_POSIX),y)
> +ifneq ($(CONFIG_SOLARIS),y)
>  LIBS += -lutil
>  endif
> +endif

I don't object to this patch in principle, but I don't think
this is the best way to fix the underlying problem.

My assumption is that the issue is that Solaris doesn't
have a -lutil (it's helpful to quote the linker or
compiler error message for this kind of patch to clarify
what the failure is that we're trying to fix).

It looks like we use libutil here for openpty, which
is used in the test-char test. But the condition we're
using in tests/Makefile.include isn't the same as the
one we used to decide whether to add -lutil to the
emulator binary link line, which is in configure:

if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \
        "$aix" != "yes" -a "$haiku" != "yes" ; then
    libs_softmmu="-lutil $libs_softmmu"
fi

So I think I'd prefer it if we have:
 * a configure test for "is openpty() in libutil"
 * use that to determine whether to add -lutil to
   libs_softmmu and to the libs for tests, rather than
   doing OS-specific tests

Q: does Solaris still not have an openpty() implementation?
Currently we have a local implementation in util/qemu-openpty.c,
but if that workaround is only needed in old Solaris we don't
support any more we could perhaps drop it.

thanks
-- PMM
Kamil Rytarowski Sept. 4, 2017, 11:46 p.m. UTC | #2
On 04.09.2017 11:32, Peter Maydell wrote:
> On 3 September 2017 at 17:49, Kamil Rytarowski <n54@gmx.com> wrote:
>> This fixes build on SmartOS (Joyent).
>>
>> Patch cherry-picked from pkgsrc by jperkin (Joyent).
>>
>> Signed-off-by: Kamil Rytarowski <n54@gmx.com>
>> ---
>>  tests/Makefile.include | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/tests/Makefile.include b/tests/Makefile.include
>> index f08b7418f0..0e5e6cb9b8 100644
>> --- a/tests/Makefile.include
>> +++ b/tests/Makefile.include
>> @@ -810,8 +810,10 @@ tests/migration/initrd-stress.img: tests/migration/stress$(EXESUF)
>>         rmdir $(INITRD_WORK_DIR)
>>
>>  ifeq ($(CONFIG_POSIX),y)
>> +ifneq ($(CONFIG_SOLARIS),y)
>>  LIBS += -lutil
>>  endif
>> +endif
> 
> I don't object to this patch in principle, but I don't think
> this is the best way to fix the underlying problem.
> 
> My assumption is that the issue is that Solaris doesn't
> have a -lutil (it's helpful to quote the linker or
> compiler error message for this kind of patch to clarify
> what the failure is that we're trying to fix).
> 

There is no libutil on SmartOS.

I cannot provide any information about the proprietary Solaris here and
in next questions.

> It looks like we use libutil here for openpty, which
> is used in the test-char test. But the condition we're
> using in tests/Makefile.include isn't the same as the
> one we used to decide whether to add -lutil to the
> emulator binary link line, which is in configure:
> 
> if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \
>         "$aix" != "yes" -a "$haiku" != "yes" ; then
>     libs_softmmu="-lutil $libs_softmmu"
> fi
> 
> So I think I'd prefer it if we have:
>  * a configure test for "is openpty() in libutil"
>  * use that to determine whether to add -lutil to
>    libs_softmmu and to the libs for tests, rather than
>    doing OS-specific tests
> 

This looks cleaner. I will go for it.

> Q: does Solaris still not have an openpty() implementation?
> Currently we have a local implementation in util/qemu-openpty.c,
> but if that workaround is only needed in old Solaris we don't
> support any more we could perhaps drop it.
> 

SmartOS does not have openpty(). I don't see it either in the mainstream
Illumos-gate repository.

According to pkgsrc, openpty() is in libutil (-lutil) on all BSDs and
Darwin.

> thanks
> -- PMM
>
Peter Maydell Sept. 5, 2017, 9:16 a.m. UTC | #3
On 5 September 2017 at 00:46, Kamil Rytarowski <n54@gmx.com> wrote:
> On 04.09.2017 11:32, Peter Maydell wrote:
>> My assumption is that the issue is that Solaris doesn't
>> have a -lutil (it's helpful to quote the linker or
>> compiler error message for this kind of patch to clarify
>> what the failure is that we're trying to fix).
>>
>
> There is no libutil on SmartOS.
>
> I cannot provide any information about the proprietary Solaris here and
> in next questions.

Yes; I was being a bit sloppy referring to all the
forks of opensolaris as 'Solaris' there. Recent news
suggests we don't need to consider support for the
proprietary Solaris...

>> It looks like we use libutil here for openpty, which
>> is used in the test-char test. But the condition we're
>> using in tests/Makefile.include isn't the same as the
>> one we used to decide whether to add -lutil to the
>> emulator binary link line, which is in configure:
>>
>> if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \
>>         "$aix" != "yes" -a "$haiku" != "yes" ; then
>>     libs_softmmu="-lutil $libs_softmmu"
>> fi
>>
>> So I think I'd prefer it if we have:
>>  * a configure test for "is openpty() in libutil"
>>  * use that to determine whether to add -lutil to
>>    libs_softmmu and to the libs for tests, rather than
>>    doing OS-specific tests
>>
>
> This looks cleaner. I will go for it.

Thanks. Remember that there are three cases to handle:
 * has openpty, don't need -lutil to get it (OSX is like this I think)
 * has openpty and you need -lutil (Linux)
 * has no openpty at all, use QEMU internal version (smartos)

thanks
-- PMM
diff mbox

Patch

diff --git a/tests/Makefile.include b/tests/Makefile.include
index f08b7418f0..0e5e6cb9b8 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -810,8 +810,10 @@  tests/migration/initrd-stress.img: tests/migration/stress$(EXESUF)
 	rmdir $(INITRD_WORK_DIR)
 
 ifeq ($(CONFIG_POSIX),y)
+ifneq ($(CONFIG_SOLARIS),y)
 LIBS += -lutil
 endif
+endif
 
 # QTest rules