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 2/3] configure: Fix building with SASL on Windows
Date: Mon, 9 Mar 2020 11:47:56 +0100 [thread overview]
Message-ID: <3efe572c-5c68-a552-9327-e0cf18007a90@redhat.com> (raw)
In-Reply-To: <20200309095746.GB3033513@redhat.com>
On 3/9/20 10:57 AM, Daniel P. Berrangé wrote:
> On Sat, Mar 07, 2020 at 06:22:21PM +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.
>> Add the definition to vnc_sasl_cflags if we are uing MinGW.
>>
>> [*] 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>
>> Cc: Youry Metlitsky <winaes@yandex.ru>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>> configure | 8 +++++++-
>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/configure b/configure
>> index 0c2dd1eb08..0bc87ce42a 100755
>> --- a/configure
>> +++ b/configure
>> @@ -3375,7 +3375,13 @@ 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=""
>> + if test "$mingw32" = "yes" && test "$iovec" != "yes"; then
>
> I don't get why we need the "iovec != yes" check there ?
>
> On mingw sys/uio.h doesn't exist, so "$iovec" will always
> be "no", and so this conditional is equivalent to
>
> if test "$mingw32" = "yes; then
Indeed.
>
> If for some strange reason, a future Windows adds sys/uio.h
> header containing struct iovec, then QEMU won't define its
> own local copy if struct iovec, and so "$iovec" will be "yes".
>
> In this situation we don't want SASL to define its struct iovec
> either.
>
> IOW we need -DSTRUCT_IOVEC_DEFINED no matter what $iovec value
> is AFAICT.
Way simpler!
>
> This would mean the previous patch is redundant too.
Yes, thanks for reviewing :)
>
>> + # 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"
>> + else
>> + vnc_sasl_cflags=""
>> + fi
>> vnc_sasl_libs="-lsasl2"
>> if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then
>> vnc_sasl=yes
>
> Regards,
> Daniel
>
next prev parent reply other threads:[~2020-03-09 10:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-07 17:22 [PATCH 0/3] buildsys: Fix building with SASL on Windows Philippe Mathieu-Daudé
2020-03-07 17:22 ` [PATCH 1/3] configure: Check for <sys/uio.h> header before external libraries Philippe Mathieu-Daudé
2020-03-07 17:22 ` [PATCH 2/3] configure: Fix building with SASL on Windows Philippe Mathieu-Daudé
2020-03-09 9:57 ` Daniel P. Berrangé
2020-03-09 10:47 ` Philippe Mathieu-Daudé [this message]
2020-03-07 17:22 ` [PATCH 3/3] tests/docker: Install SASL library to extend code coverage on amd64 Philippe Mathieu-Daudé
2020-03-09 9:52 ` Daniel P. Berrangé
2020-03-07 17:51 ` [PATCH 0/3] buildsys: Fix building with SASL on Windows no-reply
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=3efe572c-5c68-a552-9327-e0cf18007a90@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).