xref: /OK3568_Linux_fs/buildroot/package/bitcoin/0001-src-randomenv.cpp-fix-build-on-uclibc.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 330cb33985d0ce97c20f4a0f0bbda0fbffe098d4 Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Mon, 9 Nov 2020 21:18:40 +0100
4Subject: [PATCH] src/randomenv.cpp: fix build on uclibc
5
6Check for HAVE_STRONG_GETAUXVAL or HAVE_WEAK_GETAUXVAL before using
7getauxval to avoid a build failure on uclibc
8
9Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
10[Upstream status: https://github.com/bitcoin/bitcoin/pull/20358]
11---
12 src/randomenv.cpp | 6 +++---
13 1 file changed, 3 insertions(+), 3 deletions(-)
14
15diff --git a/src/randomenv.cpp b/src/randomenv.cpp
16index 07122b7f6..5e07c3db4 100644
17--- a/src/randomenv.cpp
18+++ b/src/randomenv.cpp
19@@ -53,7 +53,7 @@
20 #include <sys/vmmeter.h>
21 #endif
22 #endif
23-#ifdef __linux__
24+#if defined(HAVE_STRONG_GETAUXVAL) || defined(HAVE_WEAK_GETAUXVAL)
25 #include <sys/auxv.h>
26 #endif
27
28@@ -326,7 +326,7 @@ void RandAddStaticEnv(CSHA512& hasher)
29     // Bitcoin client version
30     hasher << CLIENT_VERSION;
31
32-#ifdef __linux__
33+#if defined(HAVE_STRONG_GETAUXVAL) || defined(HAVE_WEAK_GETAUXVAL)
34     // Information available through getauxval()
35 #  ifdef AT_HWCAP
36     hasher << getauxval(AT_HWCAP);
37@@ -346,7 +346,7 @@ void RandAddStaticEnv(CSHA512& hasher)
38     const char* exec_str = (const char*)getauxval(AT_EXECFN);
39     if (exec_str) hasher.Write((const unsigned char*)exec_str, strlen(exec_str) + 1);
40 #  endif
41-#endif // __linux__
42+#endif // HAVE_STRONG_GETAUXVAL || HAVE_WEAK_GETAUXVAL
43
44 #ifdef HAVE_GETCPUID
45     AddAllCPUID(hasher);
46--
472.28.0
48
49