Skip to content

Commit 330cb33

Browse files
committed
src/randomenv.cpp: fix build on uclibc
Check for HAVE_STRONG_GETAUXVAL or HAVE_WEAK_GETAUXVAL before using getauxval to avoid a build failure on uclibc Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent 1dfe19e commit 330cb33

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/randomenv.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
#include <sys/vmmeter.h>
5454
#endif
5555
#endif
56-
#ifdef __linux__
56+
#if defined(HAVE_STRONG_GETAUXVAL) || defined(HAVE_WEAK_GETAUXVAL)
5757
#include <sys/auxv.h>
5858
#endif
5959

@@ -326,7 +326,7 @@ void RandAddStaticEnv(CSHA512& hasher)
326326
// Bitcoin client version
327327
hasher << CLIENT_VERSION;
328328

329-
#ifdef __linux__
329+
#if defined(HAVE_STRONG_GETAUXVAL) || defined(HAVE_WEAK_GETAUXVAL)
330330
// Information available through getauxval()
331331
# ifdef AT_HWCAP
332332
hasher << getauxval(AT_HWCAP);
@@ -346,7 +346,7 @@ void RandAddStaticEnv(CSHA512& hasher)
346346
const char* exec_str = (const char*)getauxval(AT_EXECFN);
347347
if (exec_str) hasher.Write((const unsigned char*)exec_str, strlen(exec_str) + 1);
348348
# endif
349-
#endif // __linux__
349+
#endif // HAVE_STRONG_GETAUXVAL || HAVE_WEAK_GETAUXVAL
350350

351351
#ifdef HAVE_GETCPUID
352352
AddAllCPUID(hasher);

0 commit comments

Comments
 (0)