Subject: Re: bug#22959: Emacs on Windows depends on libwinpthreads

From: [email-masked] (Phillip Lord)
Date: Mon, 18 Apr 2016 14:06:03 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: Fabrice Popineau <[email-masked]>
>> Date: Sat, 16 Apr 2016 23:48:35 +0200
>> 
>> At this point, when I build emacs for w64 using msys2,
>> emacs.exe depends on libwinpthread for only one symbol
>> which is clock_gettime().
>> This is called from lib/gettime.c:gettime().
>
> This is not supposed to happen.  I don't see this on my system.
>
> There's some factor at work here that I cannot figure out: the
> configure-time test for clock_gettime doesn't try to look for that
> function in the pthreads library, it only tries the "normal" link
> without any extra libraries, and if that fails, tries 2 extra
> libraries: librt and libposix4, none of which I'd expect to see on
> MS-Windows in a MinGW installation.

I did get the same thing at one point.

> It could be something peculiar to MinGW64/MSYS2 build.  Are you sure
> libwinpthread dependency is not a requirement of the MinGW64 GCC port?

This was the cause of the problem for me.

>
> So please look in config.log, and tell how did pthreads get into this
> test.
>
>> It may be possible to remove this dependency for w64
>> and switch to gettimeofday(). No idea if we would lose 
>> something in doing so.
>
> Probably nothing at all, as the 32-build AFAIK doesn't depend on
> libwinpthread (at least mine doesn't).

And this, also stemmed from msys2 rather than anything different in
Emacs.

Phil