qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: "Fam Zheng" <fam@euphon.net>, "Alexey Pavlov" <alexpux@gmail.com>,
	"Алексей Павлов" <alexey.pawlow@gmail.com>,
	qemu-devel@nongnu.org,
	"Метлицкий Юрий Викторович" <winaes@narod.ru>,
	"Biswapriyo Nath" <nathbappai@gmail.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Youry Metlitsky" <winaes@yandex.ru>
Subject: Re: [PATCH v2 1/2] configure: Fix building with SASL on Windows
Date: Mon, 9 Mar 2020 12:30:14 +0000	[thread overview]
Message-ID: <20200309123014.GH3033513@redhat.com> (raw)
In-Reply-To: <20200309122454.22551-2-philmd@redhat.com>

On Mon, Mar 09, 2020 at 01:24:53PM +0100, Philippe Mathieu-Daudé wrote:
> The Simple Authentication and Security Layer (SASL) library
> re-defines the struct iovec on Win32 [*]. QEMU also re-defines
> it in "qemu/osdep.h". The two definitions then clash on a MinGW
> build.
> We can avoid the SASL definition by defining STRUCT_IOVEC_DEFINED.
> Since QEMU already defines 'struct iovec' if it is missing, add
> the definition to vnc_sasl_cflags to avoid SASL re-defining it.
> 
> [*] https://github.com/cyrusimap/cyrus-sasl/blob/cyrus-sasl-2.1.27/include/sasl.h#L187
> 
> Cc: Alexey Pavlov <alexpux@gmail.com>
> Cc: Biswapriyo Nath <nathbappai@gmail.com>
> Reported-by: Youry Metlitsky <winaes@yandex.ru>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> v2:
> Since QEMU provides 'struct iovec' if missing, always define
> STRUCT_IOVEC_DEFINED (danpb review).
> ---
>  configure | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index cbf864bff1..a4cd4bccfb 100755
> --- a/configure
> +++ b/configure
> @@ -3349,7 +3349,9 @@ if test "$vnc" = "yes" && test "$vnc_sasl" != "no" ; then
>  int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
>  EOF
>    # Assuming Cyrus-SASL installed in /usr prefix
> -  vnc_sasl_cflags=""
> +  # QEMU defines struct iovec in "qemu/osdep.h",
> +  # we don't want libsasl to redefine it in <sasl/sasl.h>.
> +  vnc_sasl_cflags="-DSTRUCT_IOVEC_DEFINED"
>    vnc_sasl_libs="-lsasl2"
>    if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then
>      vnc_sasl=yes

This works so:

  Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


however, I'm wondering if we'd be better doing this in a more
localized place. This applies to everything we compile, but
only one place imports sasl.h, so should we instead do

   #define STRUCT_IOVEC_DEFINED
   #include <sasl/saslh.>

in vnc-auth-sasl.h, so we localize the namespace pollution.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2020-03-09 12:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-09 12:24 [PATCH v2 0/2] buildsys: Fix building with SASL on Windows Philippe Mathieu-Daudé
2020-03-09 12:24 ` [PATCH v2 1/2] configure: " Philippe Mathieu-Daudé
2020-03-09 12:30   ` Daniel P. Berrangé [this message]
2020-03-09 12:43     ` Philippe Mathieu-Daudé
2020-03-09 12:24 ` [PATCH v2 2/2] tests/docker: Install SASL library to extend code coverage on amd64 Philippe Mathieu-Daudé
2020-03-11 18:38 ` [PATCH v2 0/2] buildsys: Fix building with SASL on Windows Paolo Bonzini

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=20200309123014.GH3033513@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=alexey.pawlow@gmail.com \
    --cc=alexpux@gmail.com \
    --cc=fam@euphon.net \
    --cc=nathbappai@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=winaes@narod.ru \
    --cc=winaes@yandex.ru \
    /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).