File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -193,6 +193,11 @@ HUGE_PAGES =
193193OS_FLAGS = -I/usr/local/cxx_atomics
194194endif
195195
196+ ifeq ($(UNAME ) , NetBSD)
197+ STRIP = strip -s $(BUILD_DIR ) /$(LIBNAME )
198+ HUGE_PAGES =
199+ endif
200+
196201HOOKS = $(MALLOC_HOOK )
197202OPTIMIZE = -O2 -fstrict-aliasing -Wstrict-aliasing
198203COMMON_CFLAGS = -Wall -Iinclude/ $(THREAD_SUPPORT ) $(PRE_POPULATE_PAGES ) $(STARTUP_MEM_USAGE )
Original file line number Diff line number Diff line change 1515#include <Security/SecRandom.h>
1616#elif __FreeBSD__ || __DragonFly__ || __linux__ || __ANDROID__
1717#include <sys/random.h>
18+ #elif __NetBSD__
19+ #include <stdlib.h>
1820#else
1921#error "unknown OS"
2022#endif
@@ -34,6 +36,10 @@ INTERNAL_HIDDEN uint64_t rand_uint64(void) {
3436 ret = SecRandomCopyBytes (kSecRandomDefault , sizeof (val ), & val );
3537#elif __FreeBSD__ || __DragonFly__ || __linux__ || __ANDROID__
3638 ret = getrandom (& val , sizeof (val ), GRND_NONBLOCK ) != sizeof (val );
39+ #elif __NetBSD__
40+ /* Temporary solution until NetBSD 10 released with getrandom support
41+ */
42+ arc4random_buf (& val , sizeof (val ));
3743#endif
3844
3945#if ABORT_NO_ENTROPY
You can’t perform that action at this time.
0 commit comments