Commit Graph

4 Commits

Author SHA1 Message Date
Yann E. MORIN
a487cd4f8f libcommon: check for getrandom()
Not all C libraries are glibc, or impersonating it; for example, musl
does not pretend to be any version of glibc. Thus, building on musl
fails when openssl is disabled, because no random-providing function is
detected, although musl does provide getrandom().

uClibc-ng on the other hand, can impersonate glibc, but availability of
getrandom() is not guatranteed there: getrandom() can be compiled out of
uClinbc-ng, or uClibc-ng can be too old to have it.

Add a configure-time check that getrandom() is available, as a fallback
when TLS is not enabled (and thus openssl is not used), and when not on
Win32 (where getting random numbers is always possible, at least from a
build perspective).

However, building with the plain Makefiles should keep working, so
slightly rework the defines checks in the code to account for the fact
that HAVE_GETRANDOM may already be defined at configure time.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
2026-02-25 08:27:42 +00:00
Roger A. Light
67ad22df0a Formatting: Double space before functions. 2025-09-17 12:03:03 +01:00
Roger A. Light
43dda2ae20 Fix some build variants 2025-07-10 16:08:49 +01:00
Roger A. Light
8cc21d1fa4 Refactor random functions to common static library. 2024-03-17 21:57:15 +00:00