To be correct, the problem is not in the Cygwin installation, the problem is in v8's #ifdef logic: WIN32 does not necessarily imply VisualStudio or MinGW. In the case at hand, we have a POSIX-compliant random(), but its signature doesn't match the POSIX one, which returns a long:
http://www.unix.com/man-page/POSIX/3posix/random/.
Although Cygwin is not officially supported, we should nevertheless fix the signature and the #ifdef logic. For the latter, we should really, really move away from the totally broken and unmaintainable platform-centric #ifdefs towards feature-centric #ifdefs, a lesson the autotools community has learned 2-3 decades ago...