0002-lib-getrandom.c-fix-build-with-uclibc-1.0.35.patch 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. From 236b019b83228d2e37fa07635fb6864ed7dc5fad Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Thu, 1 Apr 2021 07:49:46 +0200
  4. Subject: [PATCH] lib/getrandom.c: fix build with uclibc < 1.0.35
  5. Fix the following build failure with uclibc < 1.0.35 which is raised
  6. since the addition of getrandom module in
  7. https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=682cc4e678aceff32dea2a84b6e5147bdf5a20a7:
  8. In file included from ./sys/random.h:40,
  9. from getrandom.c:22:
  10. /tmp/instance-0/output-1/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:27:35: error: unknown type name 'size_t'
  11. 27 | extern int getrandom(void *__buf, size_t count, unsigned int flags)
  12. | ^~~~~~
  13. /tmp/instance-0/output-1/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:8:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
  14. 7 | #include <features.h>
  15. +++ |+#include <stddef.h>
  16. 8 |
  17. This patch is not upstreamable as it is only a workaround for
  18. uclibc < 1.0.35, upstream uclibc has been patched with
  19. https://github.com/wbx-github/uclibc-ng/commit/00972c02c2b6e0a95d5def4a71bdfb188e091782
  20. Fixes:
  21. - http://autobuild.buildroot.org/results/30105094e39374ec6d4e47e2fb5e99696f7f7981
  22. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  23. ---
  24. gl-libpoke/getrandom.c | 1 +
  25. gl/getrandom.c | 1 +
  26. jitter/gnulib-local/getrandom.c | 1 +
  27. 3 files changed, 3 insertions(+)
  28. diff --git a/gl-libpoke/getrandom.c b/gl-libpoke/getrandom.c
  29. index e146873..3948d8d 100644
  30. --- a/gl-libpoke/getrandom.c
  31. +++ b/gl-libpoke/getrandom.c
  32. @@ -19,6 +19,7 @@
  33. #include <config.h>
  34. +#include <stddef.h>
  35. #include <sys/random.h>
  36. #include <errno.h>
  37. diff --git a/gl/getrandom.c b/gl/getrandom.c
  38. index e146873..3948d8d 100644
  39. --- a/gl/getrandom.c
  40. +++ b/gl/getrandom.c
  41. @@ -19,6 +19,7 @@
  42. #include <config.h>
  43. +#include <stddef.h>
  44. #include <sys/random.h>
  45. #include <errno.h>
  46. diff --git a/jitter/gnulib-local/getrandom.c b/jitter/gnulib-local/getrandom.c
  47. index e146873..3948d8d 100644
  48. --- a/jitter/gnulib-local/getrandom.c
  49. +++ b/jitter/gnulib-local/getrandom.c
  50. @@ -19,6 +19,7 @@
  51. #include <config.h>
  52. +#include <stddef.h>
  53. #include <sys/random.h>
  54. #include <errno.h>
  55. --
  56. 2.31.1