Error while trying to compile libgcrypt on macOS

Ángel angel at pgp.16bits.net
Sun May 7 05:31:21 CEST 2023


On 2023-05-06 at 07:51 +0200, Pedro Andres Aranda Gutierrez wrote:
> Hi
> 
> I was just trying to compile libgcrypt 1.10.2 on my Mac
> 
> libgcrypt ➤ uname -a
> Darwin paag-MacBookAir 21.6.0 Darwin Kernel Version 21.6.0: Thu Mar
>  9 20:08:59 PST 2023; root:xnu-8020.240.18.700.8~1/RELEASE_X86_64
> x86_64
> 
> And I got the following error:
> 
> /bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.
> -I..  -I../src -I../src -I/usr/local/include -I/usr/local/include
> -arch x86_64 -Os -fno-delete-null-pointer-checks -Wall -MT
> rndgetentropy.lo -MD -MP -MF ..deps/rndgetentropy.Tpo -c -o
> rndgetentropy.lo rndgetentropy.c
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src
> -I/usr/local/include -I/usr/local/include -arch x86_64 -Os -fno-
> delete-null-pointer-checks -Wall -MT rndgetentropy.lo -MD -MP -MF
> ..deps/rndgetentropy.Tpo -c rndgetentropy.c  -fno-common -DPIC -o
> ..libs/rndgetentropy.o
> rndgetentropy.c:98:21: error: implicit declaration of function
> 'getrandom' is invalid in C99 [-Werror,-Wimplicit-function-
> declaration]
>               ret = getrandom (buffer, nbytes, GRND_RANDOM);
>                     ^
> rndgetentropy.c:98:48: error: use of undeclared identifier
> 'GRND_RANDOM'
>               ret = getrandom (buffer, nbytes, GRND_RANDOM);
>                                                ^
> 2 errors generated.
> 
> This all in my effort to get gnupg 2.4.1 running from the tarballs in
> gnupg.org
> 
> Thanks for any help, /PA

It is trying to compile for using a Linux syscall (getrandom) which is
not available in Mac OS.

How did you run configure? What did it output about getrandom?






More information about the Gnupg-devel mailing list