0001-src-randomenv.cpp-fix-build-on-uclibc.patch 1.5 KB

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