From 403242d214b6cb919ed08f2149d7bee77a060947 Mon Sep 17 00:00:00 2001 From: Tomas Korbar Date: Thu, 20 Feb 2020 07:37:55 +0100 Subject: [PATCH] pimd: Make frr able to be built by gcc 10 - Add extern modifier to some declarations in header file and move qpim_all_pim_routers_addr definition to pimd/pimd.c `GCC now defaults to -fno-common. As a result, global variable accesses are more efficient on various targets. In C, global variables with multiple tentative definitions now result in linker errors.` Taken from https://gcc.gnu.org/gcc-10/changes.html Signed-off-by: Tomas Korbar --- pimd/pimd.c | 1 + pimd/pimd.h | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pimd/pimd.c b/pimd/pimd.c index 889a83a136..0a7ac3b31f 100644 --- a/pimd/pimd.c +++ b/pimd/pimd.c @@ -50,6 +50,7 @@ const char *const PIM_ALL_IGMP_ROUTERS = MCAST_ALL_IGMP_ROUTERS; DEFINE_MTYPE_STATIC(PIMD, ROUTER, "PIM Router information"); struct pim_router *router = NULL; +struct in_addr qpim_all_pim_routers_addr; void pim_prefix_list_update(struct prefix_list *plist) { diff --git a/pimd/pimd.h b/pimd/pimd.h index 70d2766220..88e692b50d 100644 --- a/pimd/pimd.h +++ b/pimd/pimd.h @@ -131,14 +131,14 @@ #define PIM_UPDATE_SOURCE_DUP -10 #define PIM_GROUP_BAD_ADDR_MASK_COMBO -11 -const char *const PIM_ALL_SYSTEMS; -const char *const PIM_ALL_ROUTERS; -const char *const PIM_ALL_PIM_ROUTERS; -const char *const PIM_ALL_IGMP_ROUTERS; +extern const char *const PIM_ALL_SYSTEMS; +extern const char *const PIM_ALL_ROUTERS; +extern const char *const PIM_ALL_PIM_ROUTERS; +extern const char *const PIM_ALL_IGMP_ROUTERS; extern struct pim_router *router; extern struct zebra_privs_t pimd_privs; -struct in_addr qpim_all_pim_routers_addr; +extern struct in_addr qpim_all_pim_routers_addr; extern uint8_t qpim_ecmp_enable; extern uint8_t qpim_ecmp_rebalance_enable; -- 2.39.5