[libvirt] [PATCH] build: fix build on mingw with winpthreads

Eric Blake eblake at redhat.com
Mon Jan 13 16:15:56 UTC 2014


On 01/10/2014 02:09 PM, Eric Blake wrote:
> On my Fedora 20 box with mingw cross-compiler, the build failed with:
> 
> ../../src/rpc/virnetclient.c: In function 'virNetClientSetTLSSession':
> ../../src/rpc/virnetclient.c:745:14: error: unused variable 'oldmask' [-Werror=unused-variable]
>      sigset_t oldmask, blockedsigs;
>               ^
> 
> I traced it to the fact that mingw64-winpthreads installs a header
> that does #define pthread_sigmask(...) 0, which means any argument
> only ever passeed to pthread_sigmask is reported as unused.  This
> patch works around the compilation failure, with behavior no worse
> than what mingw already gives us regarding the function being a
> no-op.
> 
> * configure.ac (pthread_sigmask): Probe for broken mingw macro.
> * src/util/virutil.h (pthread_sigmask): Rewrite to something that
> avoids unused variables.
> 
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
> 
> Tested for both mingw and Linux; I'll probably push this under
> the build-breaker rule on Monday if I don't have a review first.

I've now pushed this under the build-breaker rule.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140113/78bde823/attachment-0001.sig>


More information about the libvir-list mailing list