qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] Discover openpty(3) dynamical


From: Kamil Rytarowski
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] Discover openpty(3) dynamically in configure
Date: Sat, 28 Oct 2017 19:07:46 +0200
User-agent: Mozilla/5.0 (X11; NetBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 14.09.2017 15:52, Peter Maydell wrote:
> On 11 September 2017 at 18:16, Kamil Rytarowski <address@hidden> wrote:
>> openpty(3) might:
>>  - exists in libc (OSX)
>>  - exists in libutil (GNU, BSD)
>>  - does not exist (SmartOS)
>>
>> Add a function to discover this function in the ./configure script.
>> Add new config types: CONFIG_OPENPTY_LIBC and CONFIG_OPENPTY_LIBUTIL,
>> respectively defined when openpts(3) links with -lc or -lutil.
>>
>> Replace the condition adding -lutil in tests (for openpty(3)) from
>> CONFIG_POSIX to CONFIG_OPENPTY_LIBUTIL.
>>
>> Replace the fallback openpty(3) impelementation comment from Solaris
>> to SmartOS. Solaris is EOL'ed and it's confirmed that it does not work
>> on Oracle Solaris.
>> ---
>>  configure              | 25 +++++++++++++++++++++++++
>>  tests/Makefile.include |  2 +-
>>  util/qemu-openpty.c    |  4 ++--
>>  3 files changed, 28 insertions(+), 3 deletions(-)
>>
>> diff --git a/configure b/configure
>> index fd7e3a5e81..a614adcd29 100755
>> --- a/configure
>> +++ b/configure
>> @@ -3819,6 +3819,25 @@ EOF
>>    fi
>>  fi
>>
>> +##########################################
>> +# openpty probe
>> +openpty_libc=no
>> +openpty_libutil=no
>> +cat > $TMPC << EOF
>> +extern int openpty(int *amaster, int *aslave, char *name, void *termp, void 
>> *winp);
> 
> I think the need to provide a prototype here rather than
> using the system header to define it is revealing that we
> also need a configure test for
>  * openpty() in <pty.h>
>  * openpty() in <libutil.h>
>  * openpty() in <util.h>
> 
> Something like this untested code ought to do:
> 
> cat > $TMPC << EOF
> #if defined(CONFIG_OPENPTY_IN_PTY_H)
> #include <pty.h>
> #elif defined(CONFIG_OPENPTY_IN_LIBUTIL_H)
> #include <libutil.h>
> #elif defined(CONFIG_OPENPTY_IN_UTIL_H)
> #include <util.h>
> #endif
> int main(void) { return openpty(0, 0, 0, 0, 0); }
> EOF
> 
> # Different platforms put openpty() in different headers,
> # and may or may not need us to link against -lutil
> if compile_prog -DCONFIG_OPENPTY_IN_PTY_H ""; then
>   openpty_in_pty_h=yes
> elif compile_prog -D_CONFIG_OPENPTY_IN_PTY_H -lutil; then
>   openpty_in_pty_h=yes
>   openpty_libutil=yes
> elif compile_object -DCONFIG_OPENPTY_IN_LIBUTIL_H; then
>   openpty_in_libutil_h=yes
> elif compile_prog -D_CONFIG_OPENPTY_IN_LIBUTIL_H -lutil; then
>   openpty_in_libutil_h=yes
>   openpty_libutil=yes
> elif compile_object -DCONFIG_OPENPTY_IN_UTIL_H; then
>   openpty_in_util_h=yes
> elif compile_prog -D_CONFIG_OPENPTY_IN_UTIL_H -lutil; then
>   openpty_in_util_h=yes
>   openpty_libutil=yes
> fi
> 
> Then in qemu-openpty.c we can do
> 
> #include <termios.h>
> 
> #if defined(CONFIG_OPENPTY_IN_PTY_H)
> #include <pty.h>
> #elif defined(CONFIG_OPENPTY_IN_LIBUTIL_H)
> #include <libutil.h>
> #elif defined(CONFIG_OPENPTY_IN_UTIL_H)
> #include <util.h>
> #else
> /* sunos fallback code */
> #endif
> 
> 
>> +if test "$openpty_libc" = "yes" ; then
>> +  echo "CONFIG_OPENPTY_LIBC=y" >> $config_host_mak
>> +fi
> 
> 
> If we use the CONFIG_OPENPTY_IN_*_H constants as above
> we don't need CONFIG_OPENPTY_LIBC any more.
> 
> thanks
> -- PMM
> 
Hello,

I've naively expected that once a build on a certain OS will be fixed,
it will be functional for longer period (at least few weeks). In one
month qemu has been broken on DragonFly and SmartOS so they are not just
broken in tests, but also in the basic build.

SmartOS has new compatibility problems with grep(1) invocations and tpm
emulator fatal build failure. Few old problems with conflicts with
system headers like conflicts with symbols CS and REG_SP.

There are certainly other small incompatibility problems, after the
breakage. Just a remind that SmartOS was not capable to execute tests
because of incompatible diff(1) invocations and unclear gmake(1)
misbehavior. And this was just the beginning of the problems.

DragonFlyBSD has problems with PAGE_SIZE, PAGE_MASK clash with headers
in s390x code. PAGE_MASK, PAGE_SHIFT and PAGE_SIZE in nand. No single
GTESTER invocation passes.

Because there is need to fix the SmartOS build in order to improve this
openpty(3) patch, I'm resigning from it. I also resign from helping
DragonFly port.

I will focus entirely on the bits that I registered as a maintainer.

I leave the decisions and steps about support of these platforms to
other volunteers and qemu core maintainers.

+ CC Antonio and Peter

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]