2
1

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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. From 09758ebb191da659563b4c33334295ce21ecae71 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. Upstream: Not applicable (Buildroot specific)
  24. [Julien: refreshed the patch to be applied with fuzz factor 0]
  25. Signed-off-by: Julien Olivain <ju.o@free.fr>
  26. ---
  27. gl-libpoke/getrandom.c | 1 +
  28. gl/getrandom.c | 1 +
  29. jitter/gnulib-local/getrandom.c | 1 +
  30. 3 files changed, 3 insertions(+)
  31. diff --git a/gl-libpoke/getrandom.c b/gl-libpoke/getrandom.c
  32. index 19bb342..0251e0f 100644
  33. --- a/gl-libpoke/getrandom.c
  34. +++ b/gl-libpoke/getrandom.c
  35. @@ -19,6 +19,7 @@
  36. #include <config.h>
  37. +#include <stddef.h>
  38. #include <sys/random.h>
  39. #include <errno.h>
  40. diff --git a/gl/getrandom.c b/gl/getrandom.c
  41. index 19bb342..0251e0f 100644
  42. --- a/gl/getrandom.c
  43. +++ b/gl/getrandom.c
  44. @@ -19,6 +19,7 @@
  45. #include <config.h>
  46. +#include <stddef.h>
  47. #include <sys/random.h>
  48. #include <errno.h>
  49. diff --git a/jitter/gnulib-local/getrandom.c b/jitter/gnulib-local/getrandom.c
  50. index 19bb342..0251e0f 100644
  51. --- a/jitter/gnulib-local/getrandom.c
  52. +++ b/jitter/gnulib-local/getrandom.c
  53. @@ -19,6 +19,7 @@
  54. #include <config.h>
  55. +#include <stddef.h>
  56. #include <sys/random.h>
  57. #include <errno.h>
  58. --
  59. 2.45.2