0003-Fix-build-with-gcc-10.patch 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. From 7a446434302d7b71211b81b3c6cd12a7b35223d1 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sat, 6 Mar 2021 16:28:37 +0100
  4. Subject: [PATCH] Fix build with gcc 10
  5. Fix the following build failure with gcc 10 (which defaults to
  6. -fno-common):
  7. CCLD pimd
  8. /home/buildroot/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-gnueabihf/10.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: pimd.o:(.bss+0x8): multiple definition of `qpim_static_route_list'; pim_main.o:(.bss+0x8): first defined here
  9. /home/buildroot/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-gnueabihf/10.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: pimd.o:(.bss+0x28): multiple definition of `qpim_mroute_del_last'; pim_main.o:(.bss+0x10): first defined here
  10. Fixes:
  11. - http://autobuild.buildroot.org/results/fd5ee2b52a3cfaec268fafd3ffe4c30e51465c7e
  12. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  13. [Upstream status: https://bugzilla.quagga.net/show_bug.cgi?id=1014]
  14. ---
  15. pimd/pim_version.h | 2 +-
  16. pimd/pimd.c | 1 +
  17. pimd/pimd.h | 66 +++++++++++++++++++++++-----------------------
  18. 3 files changed, 35 insertions(+), 34 deletions(-)
  19. diff --git a/pimd/pim_version.h b/pimd/pim_version.h
  20. index ef9f370c..891d4314 100644
  21. --- a/pimd/pim_version.h
  22. +++ b/pimd/pim_version.h
  23. @@ -25,6 +25,6 @@
  24. #define PIMD_VERSION_STR "0.166"
  25. -const char * const PIMD_VERSION;
  26. +extern const char * const PIMD_VERSION;
  27. #endif /* PIM_VERSION_H */
  28. diff --git a/pimd/pimd.c b/pimd/pimd.c
  29. index 97fb2233..d7340cc0 100644
  30. --- a/pimd/pimd.c
  31. +++ b/pimd/pimd.c
  32. @@ -50,6 +50,7 @@ int64_t qpim_mroute_socket_creation = 0; /* timestamp of creat
  33. struct thread *qpim_mroute_socket_reader = 0;
  34. int qpim_mroute_oif_highest_vif_index = -1;
  35. struct list *qpim_channel_oil_list = 0;
  36. +struct in_addr qpim_all_pim_routers_addr;
  37. int qpim_t_periodic = PIM_DEFAULT_T_PERIODIC; /* Period between Join/Prune Messages */
  38. struct list *qpim_upstream_list = 0;
  39. struct zclient *qpim_zclient_update = 0;
  40. diff --git a/pimd/pimd.h b/pimd/pimd.h
  41. index 9a7e6058..8b3496fd 100644
  42. --- a/pimd/pimd.h
  43. +++ b/pimd/pimd.h
  44. @@ -68,39 +68,39 @@
  45. #define PIM_MASK_PIM_J_P (1 << 12)
  46. #define PIM_MASK_STATIC (1 << 13)
  47. -const char *const PIM_ALL_SYSTEMS;
  48. -const char *const PIM_ALL_ROUTERS;
  49. -const char *const PIM_ALL_PIM_ROUTERS;
  50. -const char *const PIM_ALL_IGMP_ROUTERS;
  51. -
  52. -struct thread_master *master;
  53. -uint32_t qpim_debugs;
  54. -int qpim_mroute_socket_fd;
  55. -int64_t qpim_mroute_socket_creation; /* timestamp of creation */
  56. -struct thread *qpim_mroute_socket_reader;
  57. -int qpim_mroute_oif_highest_vif_index;
  58. -struct list *qpim_channel_oil_list; /* list of struct channel_oil */
  59. -struct in_addr qpim_all_pim_routers_addr;
  60. -int qpim_t_periodic; /* Period between Join/Prune Messages */
  61. -struct list *qpim_upstream_list; /* list of struct pim_upstream */
  62. -struct zclient *qpim_zclient_update;
  63. -struct zclient *qpim_zclient_lookup;
  64. -struct pim_assert_metric qpim_infinite_assert_metric;
  65. -long qpim_rpf_cache_refresh_delay_msec;
  66. -struct thread *qpim_rpf_cache_refresher;
  67. -int64_t qpim_rpf_cache_refresh_requests;
  68. -int64_t qpim_rpf_cache_refresh_events;
  69. -int64_t qpim_rpf_cache_refresh_last;
  70. -struct in_addr qpim_inaddr_any;
  71. -struct list *qpim_ssmpingd_list; /* list of struct ssmpingd_sock */
  72. -struct in_addr qpim_ssmpingd_group_addr;
  73. -int64_t qpim_scan_oil_events;
  74. -int64_t qpim_scan_oil_last;
  75. -int64_t qpim_mroute_add_events;
  76. -int64_t qpim_mroute_add_last;
  77. -int64_t qpim_mroute_del_events;
  78. -int64_t qpim_mroute_del_last;
  79. -struct list *qpim_static_route_list; /* list of routes added statically */
  80. +extern const char *const PIM_ALL_SYSTEMS;
  81. +extern const char *const PIM_ALL_ROUTERS;
  82. +extern const char *const PIM_ALL_PIM_ROUTERS;
  83. +extern const char *const PIM_ALL_IGMP_ROUTERS;
  84. +
  85. +extern struct thread_master *master;
  86. +extern uint32_t qpim_debugs;
  87. +extern int qpim_mroute_socket_fd;
  88. +extern int64_t qpim_mroute_socket_creation; /* timestamp of creation */
  89. +extern struct thread *qpim_mroute_socket_reader;
  90. +extern int qpim_mroute_oif_highest_vif_index;
  91. +extern struct list *qpim_channel_oil_list; /* list of struct channel_oil */
  92. +extern struct in_addr qpim_all_pim_routers_addr;
  93. +extern int qpim_t_periodic; /* Period between Join/Prune Messages */
  94. +extern struct list *qpim_upstream_list; /* list of struct pim_upstream */
  95. +extern struct zclient *qpim_zclient_update;
  96. +extern struct zclient *qpim_zclient_lookup;
  97. +extern struct pim_assert_metric qpim_infinite_assert_metric;
  98. +extern long qpim_rpf_cache_refresh_delay_msec;
  99. +extern struct thread *qpim_rpf_cache_refresher;
  100. +extern int64_t qpim_rpf_cache_refresh_requests;
  101. +extern int64_t qpim_rpf_cache_refresh_events;
  102. +extern int64_t qpim_rpf_cache_refresh_last;
  103. +extern struct in_addr qpim_inaddr_any;
  104. +extern struct list *qpim_ssmpingd_list; /* list of struct ssmpingd_sock */
  105. +extern struct in_addr qpim_ssmpingd_group_addr;
  106. +extern int64_t qpim_scan_oil_events;
  107. +extern int64_t qpim_scan_oil_last;
  108. +extern int64_t qpim_mroute_add_events;
  109. +extern int64_t qpim_mroute_add_last;
  110. +extern int64_t qpim_mroute_del_events;
  111. +extern int64_t qpim_mroute_del_last;
  112. +extern struct list *qpim_static_route_list; /* list of routes added statically */
  113. #define PIM_JP_HOLDTIME (qpim_t_periodic * 7 / 2)
  114. --
  115. 2.30.0