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

>
> CYGWIN_NT-10.0-22621 f6904e59-bb48-4060-bea5-cf49a76e528e
> 3.7.0-0.19.g6c5537c0298e.x86_64 2025-03-28 19:43 UTC x86_64 Cygwin
>
> gcc version 15.0.1 20250223 (experimental) (GCC)
>
> This was trying to investigate
> https://github.com/msys2/msys2-runtime/issues/272
>

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to