qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Michele Denber <mdenber@gmx.com>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Peter Tribble <peter.tribble@gmail.com>
Subject: Re: Building in Solaris 11.4
Date: Mon, 29 Jun 2020 14:12:04 +0200	[thread overview]
Message-ID: <fcdd4b6c-eec5-2bfd-1004-8ac86e80bf0e@redhat.com> (raw)
In-Reply-To: <5EF772B6.2010901@gmx.com>

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	other threads:[~2020-06-29 12:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24 21:31 Building in Solaris 11.4 Michele Denber
2020-06-24 21:48 ` Eric Blake
2020-06-24 21:53   ` Eric Blake
     [not found]   ` <5EF4D332.6040003@gmx.com>
2020-06-25 18:32     ` Michele Denber
2020-06-27 16:24 ` Michele Denber
2020-06-29 12:12   ` Thomas Huth [this message]
2020-06-29 20:25     ` Michele Denber
2020-06-30  5:10       ` Thomas Huth
  -- strict thread matches above, loose matches on Subject: below --
2020-06-27 21:19 Michele Denber
2020-06-28 13:22 ` Peter Maydell
2020-06-28 14:16   ` Peter Tribble

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fcdd4b6c-eec5-2bfd-1004-8ac86e80bf0e@redhat.com \
    --to=thuth@redhat.com \
    --cc=mdenber@gmx.com \
    --cc=peter.maydell@linaro.org \
    --cc=peter.tribble@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).