[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tests on MinGW: undef ref pthread_mutex_lock/unlock
From: |
Eric Blake |
Subject: |
Re: Tests on MinGW: undef ref pthread_mutex_lock/unlock |
Date: |
Thu, 11 Apr 2019 20:26:35 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 4/11/19 7:26 PM, Bruno Haible wrote:
> Btw, I never build with mingw-pthreads installed. But even with mingw-pthreads
> installed, gnulib modules ought to not use it; they ought to use the Windows
> API instead.
Jumping in late, but this reminded me of a patch I wrote years ago:
https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=c91d13bd
> 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 passed 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.
Here we are 5 years later, and mingw32-winpthreads-5.0.4-2.fd29 still
has a broken:
/usr/i686-w64-mingw32/sys-root/mingw/include/pthread_signal.h:
#define pthread_sigmask(H, S1, S2) 0
So indeed, gnulib could do a better job at avoiding that library as more
pain than it is worth.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- Tests on MinGW: undef ref pthread_mutex_lock/unlock, Tim Rühsen, 2019/04/11
- Re: Tests on MinGW: undef ref pthread_mutex_lock/unlock, Bruno Haible, 2019/04/11
- Re: Tests on MinGW: undef ref pthread_mutex_lock/unlock, Tim Rühsen, 2019/04/11
- Re: Tests on MinGW: undef ref pthread_mutex_lock/unlock, Bruno Haible, 2019/04/11
- Re: Tests on MinGW: undef ref pthread_mutex_lock/unlock, Tim Rühsen, 2019/04/11
- Re: Tests on MinGW: undef ref pthread_mutex_lock/unlock, Tim Rühsen, 2019/04/11
- Re: Tests on MinGW: undef ref pthread_mutex_lock/unlock, Bruno Haible, 2019/04/11
- Re: Tests on MinGW: undef ref pthread_mutex_lock/unlock,
Eric Blake <=
- Re: Tests on MinGW: undef ref pthread_mutex_lock/unlock, Tim Rühsen, 2019/04/12
- Re: Tests on MinGW: undef ref pthread_mutex_lock/unlock, Bruno Haible, 2019/04/13