0001-Add-include-of-sys-sysmacro.h.patch 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. From 45c14ef4d5d7ced0fbf984208de44ced6d5ed898 Mon Sep 17 00:00:00 2001
  2. From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
  3. Date: Mon, 10 Sep 2018 15:52:09 +0200
  4. Subject: [PATCH] libusbgx: fix build with glibc-2.28 since <sys/sysmacros.h>
  5. is no more included by <sys/types.h>
  6. Since https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html sys/sysmacros.h
  7. must be explicitly included.
  8. Without sys/sysmacros.h and with glibc-2.28 build fails with error like:
  9. src/.libs/libusbgx.so: undefined reference to minor' src/.libs/libusbgx.so: undefined reference tomajor'
  10. src/.libs/libusbgx.so: undefined reference to `makedev'
  11. Signed-off-by: Sid Spry <R030t1@gmail.com>
  12. Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
  13. ---
  14. examples/gadget-acm-ecm.c | 1 +
  15. examples/gadget-import.c | 1 +
  16. examples/gadget-ms.c | 1 +
  17. examples/show-gadgets.c | 1 +
  18. examples/show-udcs.c | 1 +
  19. include/usbg/usbg_internal_libconfig.h | 1 +
  20. 6 files changed, 6 insertions(+)
  21. diff --git a/examples/gadget-acm-ecm.c b/examples/gadget-acm-ecm.c
  22. index 1c5e2ca..29360da 100644
  23. --- a/examples/gadget-acm-ecm.c
  24. +++ b/examples/gadget-acm-ecm.c
  25. @@ -20,6 +20,7 @@
  26. #include <errno.h>
  27. #include <stdio.h>
  28. +#include <sys/sysmacros.h>
  29. #include <linux/usb/ch9.h>
  30. #include <usbg/usbg.h>
  31. diff --git a/examples/gadget-import.c b/examples/gadget-import.c
  32. index e684fdb..63df449 100644
  33. --- a/examples/gadget-import.c
  34. +++ b/examples/gadget-import.c
  35. @@ -25,6 +25,7 @@
  36. #include <errno.h>
  37. #include <string.h>
  38. #include <stdio.h>
  39. +#include <sys/sysmacros.h>
  40. #include <usbg/usbg.h>
  41. int main(int argc, char **argv)
  42. diff --git a/examples/gadget-ms.c b/examples/gadget-ms.c
  43. index 478c370..a5c6681 100644
  44. --- a/examples/gadget-ms.c
  45. +++ b/examples/gadget-ms.c
  46. @@ -23,6 +23,7 @@
  47. #include <errno.h>
  48. #include <stdio.h>
  49. +#include <sys/sysmacros.h>
  50. #include <linux/usb/ch9.h>
  51. #include <usbg/usbg.h>
  52. #include <usbg/function/ms.h>
  53. diff --git a/examples/show-gadgets.c b/examples/show-gadgets.c
  54. index 707d448..a2a21c8 100644
  55. --- a/examples/show-gadgets.c
  56. +++ b/examples/show-gadgets.c
  57. @@ -21,6 +21,7 @@
  58. #include <errno.h>
  59. #include <stdio.h>
  60. #include <string.h>
  61. +#include <sys/sysmacros.h>
  62. #include <netinet/ether.h>
  63. #include <usbg/usbg.h>
  64. #include <usbg/function/ms.h>
  65. diff --git a/examples/show-udcs.c b/examples/show-udcs.c
  66. index 66e950f..2f5cc45 100644
  67. --- a/examples/show-udcs.c
  68. +++ b/examples/show-udcs.c
  69. @@ -23,6 +23,7 @@
  70. #include <errno.h>
  71. #include <stdio.h>
  72. +#include <sys/sysmacros.h>
  73. #include <usbg/usbg.h>
  74. int main(void)
  75. diff --git a/include/usbg/usbg_internal_libconfig.h b/include/usbg/usbg_internal_libconfig.h
  76. index ac51758..3fa55c0 100644
  77. --- a/include/usbg/usbg_internal_libconfig.h
  78. +++ b/include/usbg/usbg_internal_libconfig.h
  79. @@ -12,6 +12,7 @@
  80. #ifndef USBG_INTERNAL_LIBCONFIG_H
  81. #define USBG_INTERNAL_LIBCONFIG_H
  82. +#include <sys/sysmacros.h>
  83. #include <libconfig.h>
  84. #ifdef __cplusplus
  85. extern "C" {
  86. --
  87. 2.16.4