util/nvmutil: enable arc4random on linux

not available on older systems. can just pass
the relevant flag in the compiler:

HAVE_ARC4RANDOM_BUF=0 at build time if you need
the fallback.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-14 18:57:40 +00:00
parent 8ccdde57e1
commit 5b4168c763
+7 -1
View File
@@ -15,8 +15,14 @@
* -Os -Wall -Wextra -Werror -pedantic -std=c90
*/
/*
* NOTE: older Linux lacked arc4random.
* added in glibc 2.36. Just pass HAVE_ARC4RANDOM_BUF=0
* at build time if you need old Linux / other libc.
*/
#if defined(__OpenBSD__) || defined(__FreeBSD__) || \
defined(__NetBSD__) || defined(__APPLE__)
defined(__NetBSD__) || defined(__APPLE__) || \
defined(__linux__)
#ifndef HAVE_ARC4RANDOM_BUF
#define HAVE_ARC4RANDOM_BUF 1
#endif