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().
It may be possible to remove this dependency for w64
and switch to gettimeofday(). No idea if we would lose
something in doing so.
There is another dependency which is libdbus.dll, which
is automatically found. I have no idea if dbus is useful
I may add that a full blown emacs compiled with msys2
needs up to 57 dlls to run ( that is : all image formats dll,
gnutls, etc.) and this is what I copy in my emacs/bin directory.