0001-src-fix-compilation-for-glibc-version-2.27.9000-36.f.patch 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. From 1c80e31872aec9f2ef7eca6a52aa89c0ea759d8f Mon Sep 17 00:00:00 2001
  2. From: Enrico Joerns <ejo@pengutronix.de>
  3. Date: Wed, 5 Sep 2018 12:28:28 +0200
  4. Subject: [PATCH] src: fix compilation for glibc version 2.27.9000-36.fc29 and
  5. newer
  6. As recent glibc versions (>= 2.27.9000-36.fc29) also define 'struct
  7. statx' which is also defined in linux/stat.h, compilation fails with
  8. error:
  9. | In file included from ../dt-utils-2018.05.0/src/crypto/digest.c:24:
  10. | [..]/usr/include/linux/stat.h:56:8: error: redefinition of 'struct statx_timestamp'
  11. | struct statx_timestamp {
  12. | ^~~~~~~~~~~~~~~
  13. | In file included from [..]/usr/include/sys/stat.h:446,
  14. | from ../dt-utils-2018.05.0/src/dt/common.h:15,
  15. | from ../dt-utils-2018.05.0/src/crypto/digest.c:19:
  16. | [..]/usr/include/bits/statx.h:25:8: note: originally defined here
  17. | struct statx_timestamp
  18. | ^~~~~~~~~~~~~~~
  19. | In file included from ../dt-utils-2018.05.0/src/crypto/digest.c:24:
  20. | [..]/usr/include/linux/stat.h:99:8: error: redefinition of 'struct statx'
  21. | struct statx {
  22. | ^~~~~
  23. | In file included from [..]/usr/include/sys/stat.h:446,
  24. | from ../dt-utils-2018.05.0/src/dt/common.h:15,
  25. | from ../dt-utils-2018.05.0/src/crypto/digest.c:19:
  26. | [..]/usr/include/bits/statx.h:36:8: note: originally defined here
  27. | struct statx
  28. | ^~~~~
  29. The linux/stat.h originates from the code that was copied from barebox
  30. but is not explicitly required to be linux/stat.h instead of sys/stat.h
  31. and we do not actually use struct statx.
  32. Thus it is safe to simply replace occurrences of linux/stat.h by
  33. sys/stat.h to fix compilation.
  34. Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
  35. [Thomas: backport from upstream.]
  36. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  37. ---
  38. src/barebox-state/backend_storage.c | 2 +-
  39. src/crypto/digest.c | 2 +-
  40. 2 files changed, 2 insertions(+), 2 deletions(-)
  41. diff --git a/src/barebox-state/backend_storage.c b/src/barebox-state/backend_storage.c
  42. index 53fe829..1052656 100644
  43. --- a/src/barebox-state/backend_storage.c
  44. +++ b/src/barebox-state/backend_storage.c
  45. @@ -19,7 +19,7 @@
  46. #include <linux/kernel.h>
  47. #include <linux/list.h>
  48. #include <linux/mtd/mtd-abi.h>
  49. -#include <linux/stat.h>
  50. +#include <sys/stat.h>
  51. #include <linux/fs.h>
  52. #include <malloc.h>
  53. #include <printk.h>
  54. diff --git a/src/crypto/digest.c b/src/crypto/digest.c
  55. index 7a8c3c0..8353412 100644
  56. --- a/src/crypto/digest.c
  57. +++ b/src/crypto/digest.c
  58. @@ -21,7 +21,7 @@
  59. #include <malloc.h>
  60. #include <fs.h>
  61. #include <fcntl.h>
  62. -#include <linux/stat.h>
  63. +#include <sys/stat.h>
  64. #include <errno.h>
  65. #include <module.h>
  66. #include <linux/err.h>
  67. --
  68. 2.19.2