From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Daniel P. Berrangé" <berrange@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 13:43:35 +0100 [thread overview]
Message-ID: <4b275fa8-45e9-a3bf-a915-70c1651ce84c@redhat.com> (raw)
In-Reply-To: <20200309123014.GH3033513@redhat.com>
On 3/9/20 1:30 PM, Daniel P. Berrangé wrote:
> 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.
Good idea, but we'll need to remember this fix if we ever use
<sasl/sasl.h> in another header.
>
> Regards,
> Daniel
>
next prev parent reply other threads:[~2020-03-09 12:49 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é
2020-03-09 12:43 ` Philippe Mathieu-Daudé [this message]
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=4b275fa8-45e9-a3bf-a915-70c1651ce84c@redhat.com \
--to=philmd@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=alexey.pawlow@gmail.com \
--cc=alexpux@gmail.com \
--cc=berrange@redhat.com \
--cc=fam@euphon.net \
--cc=nathbappai@gmail.com \
--cc=pbonzini@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).