cmake 4.0.0 fails to build with cygwin 3.7.0-0.19
Corinna Vinschen
corinna-cygwin@cygwin.com
Sun Mar 30 22:01:33 GMT 2025
On Mar 30 14:02, Jeremy Drake via Cygwin wrote:
> On Sun, 30 Mar 2025, Jeremy Drake via Cygwin wrote:
>
> > I tried to build cmake 4.0.0 with latest test gcc and cygwin packages, and
> > got the following error
> >
> > /home/WDAGUtilityAccount/cmake-4.0.0/Utilities/cmcurl/lib/rand.c: In
> > function ‘weak_random’:
> > /home/WDAGUtilityAccount/cmake-4.0.0/Utilities/cmcurl/lib/rand.c:124:21:
> > error: implicit declaration of function ‘arc4random’; did you mean
> > ‘srandom’? [-Wimplicit-function-declaration]
> > 124 | r = (unsigned int)arc4random();
> > | ^~~~~~~~~~
> > | srandom
> > make[2]: *** [Utilities/cmcurl/lib/CMakeFiles/cmcurl.dir/build.make:1423:
> > Utilities/cmcurl/lib/CMakeFiles/cmcurl.dir/rand.c.o] Error 1
> > make[2]: *** Waiting for unfinished jobs....
>
> I kind of think
> https://github.com/Kitware/CMake/blob/5978c57c20b762a5aeb4b00f31a51a090d670430/Utilities/cmcurl/CMakeLists.txt#L165
> should match "^(Linux|Cygwin)$"... Otherwise it doesn't get __BSD_VISIBLE
> and
> arc4random is not defined in the header (it looks for arc4random *symbol*
> on
> https://github.com/Kitware/CMake/blob/5978c57c20b762a5aeb4b00f31a51a090d670430/Utilities/cmcurl/CMakeLists.txt#L1982
Sounds right. It makes sense to define _GNU_SOURCE, probably.
Corinna
More information about the Cygwin
mailing list