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