qemu-devel
[Top][All Lists]
Advanced

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

Re: Building in Solaris 11.4


From: Thomas Huth
Subject: Re: Building in Solaris 11.4
Date: Mon, 29 Jun 2020 14:12:04 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 27/06/2020 18.24, Michele Denber wrote:
Well the make ran for a while and then stopped here:


root@hemlock:~/qemu-5.0.0# gmake -j16
...
   CC      util/bitops.o
util/qemu-openpty.c:56:12: error: static declaration of \u2018openpty\u2019 follows non-static declaration
  static int openpty(int *amaster, int *aslave, char *name,
             ^~~~~~~
In file included from /usr/include/termios.h:8:0,
                  from util/qemu-openpty.c:48:
/usr/include/sys/termios.h:538:12: note: previous declaration of \u2018openpty\u2019 was here  extern int openpty(int *, int *, char *, struct termios *, struct winsize *);
             ^~~~~~~
gmake: *** [/export/home/denber/qemu-5.0.0/rules.mak:69: util/qemu-openpty.o] Error 1

Interestingly, I ran across this openpty issue last year while building QEMU 2.12 in Solaris 10, here: https://bugs.launchpad.net/qemu/+bug/1777252

It looks like the change to fix that issue (missing openpty in Solaris) is having some trouble.  I'm not a good enough C programmer to figure it out.  Remove the openpty declaration from util/openpty.c perhaps?

It's not the same bug as last year, but a new one: Seems like newer versions of Solaris now have this functions in their libraries! So what you want is something like this (completely untested):

diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -5159,10 +5159,14 @@ extern int openpty(int *am, int *as, char *name, void *termp, void *winp);
 int main(void) { return openpty(0, 0, 0, 0, 0); }
 EOF

-if ! compile_prog "" "" ; then
+have_openpty="no"
+if compile_prog "" "" ; then
+  have_openpty="yes"
+else
   if compile_prog "" "-lutil" ; then
     libs_softmmu="-lutil $libs_softmmu"
     libs_tools="-lutil $libs_tools"
+    have_openpty="yes"
   fi
 fi

@@ -7407,6 +7411,9 @@ fi
 if test "$have_broken_size_max" = "yes" ; then
     echo "HAVE_BROKEN_SIZE_MAX=y" >> $config_host_mak
 fi
+if test "$have_openpty" = "yes" ; then
+    echo "HAVE_OPENPTY=y" >> $config_host_mak
+fi

 # Work around a system header bug with some kernel/XFS header
 # versions where they both try to define 'struct fsxattr':
diff --git a/util/qemu-openpty.c b/util/qemu-openpty.c
--- a/util/qemu-openpty.c
+++ b/util/qemu-openpty.c
@@ -52,7 +52,8 @@
 #endif

 #ifdef __sun__
-/* Once Solaris has openpty(), this is going to be removed. */
+
+#if !defined(HAVE_OPENPTY)
 static int openpty(int *amaster, int *aslave, char *name,
                    struct termios *termp, struct winsize *winp)
 {
@@ -93,6 +94,7 @@ err:
         close(mfd);
         return -1;
 }
+#endif

 static void cfmakeraw (struct termios *termios_p)
 {

 HTH,
  Thomas




reply via email to

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