[tz] Errors compiling 2022f on macOS

Paul Eggert eggert at cs.ucla.edu
Sun Oct 30 03:53:25 UTC 2022


On 2022-10-29 15:29, Gilmore Davidson via tz wrote:

> cc -DTZDIR='"/usr/share/zoneinfo"'    -c -o zic.o zic.c
> zic.c:1194:11: error: implicit declaration of function 'getrandom' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
>        s = getrandom(entropy_buffer, sizeof entropy_buffer, 0);
>            ^

Thanks for reporting the problem. Please try the attached patch, which I 
installed in the development repository. Alternatively as you mentioned, 
you can work around this problem by appending -DHAVE_GETRANDOM=0 to CFLAGS.



> cc -DTZDIR='"/usr/share/zoneinfo"' -o zic -DHAVE_GETRANDOM=0  zic.o
> Undefined symbols for architecture x86_64:
>    "_libintl_gettext", referenced from:

This looks like a not uncommon configuration issue on macOS. You might 
try reinstalling gettext. See 
<https://github.com/EOSIO/eos/issues/2392>, which suggests:

   brew reinstall gettext
   brew unlink gettext && brew link gettext --force --overwrite

(I don't use brew so don't know what this means.) Deborah reports not 
being able to reproduce the problem on macOS; perhaps it's a macOS 
versioning issue if it's not a brew issue?

Alternatively, you can work around this second problem by appending 
"-DHAVE_GETTEXT=0" to CFLAGS. The attached patch tries to improve the 
commentary a bit in this area.


> Also, the Makefile comment for the HAVE_GETRANDOM flag says "-DHAVE_GETRANDOM if getgrandom works (e.g., GNU/Linux)*” — is “getgrandom” a typo?

Thanks, also fixed in the attached patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-GET_RANDOM-default-on-macOS.patch
Type: text/x-patch
Size: 4760 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20221029/490b3488/attachment.bin>


More information about the tz mailing list