anitazha / rpms / ndctl

Forked from rpms/ndctl 2 years ago
Clone

Blame 0001-ndctl-lib-fix-symbol-redefinitions-reported-by-GC.patch

Petr Šabata fbed67
From 0b35822caa1b8468e1a0349ccf971b600be3c03e Mon Sep 17 00:00:00 2001
Petr Šabata fbed67
From: Vishal Verma <vishal.l.verma@intel.com>
Petr Šabata fbed67
Date: Thu, 30 Jan 2020 11:51:14 -0700
Petr Šabata fbed67
Subject: [ndctl PATCH v3] ndctl/lib: fix symbol redefinitions reported by
Petr Šabata fbed67
 GCC10
Petr Šabata fbed67
Petr Šabata fbed67
A toolchain update in Fedora 32 caused new compile errors due to
Petr Šabata fbed67
multiple definitions of dimm_ops structures. The declarations in
Petr Šabata fbed67
'private.h' for the various NFIT families are present so that libndctl
Petr Šabata fbed67
can find all the per-family dimm-ops. However they need to be declared
Petr Šabata fbed67
as extern because the actual definitions are in <family>.c.
Petr Šabata fbed67
Additionally, 'param' instances in list.c and monitor.c need to be
Petr Šabata fbed67
marked as static.
Petr Šabata fbed67
Petr Šabata fbed67
Cc: Dan Williams <dan.j.williams@intel.com>
Petr Šabata fbed67
Cc: Eric Sandeen <sandeen@redhat.com>
Petr Šabata fbed67
Suggested-by: Dan Williams <dan.j.williams@intel.com>
Petr Šabata fbed67
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Petr Šabata fbed67
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Petr Šabata fbed67
---
Petr Šabata fbed67
Petr Šabata fbed67
v3: Remove unrelated changes to Makefile.am from this patch (Eric).
Petr Šabata fbed67
Petr Šabata fbed67
 ndctl/lib/private.h | 8 ++++----
Petr Šabata fbed67
 ndctl/list.c        | 2 +-
Petr Šabata fbed67
 ndctl/monitor.c     | 2 +-
Petr Šabata fbed67
 3 files changed, 6 insertions(+), 6 deletions(-)
Petr Šabata fbed67
Petr Šabata fbed67
diff --git a/ndctl/lib/private.h b/ndctl/lib/private.h
Petr Šabata fbed67
index e445301..16bf8f9 100644
Petr Šabata fbed67
--- a/ndctl/lib/private.h
Petr Šabata fbed67
+++ b/ndctl/lib/private.h
Petr Šabata fbed67
@@ -343,10 +343,10 @@ struct ndctl_dimm_ops {
Petr Šabata fbed67
 	int (*xlat_firmware_status)(struct ndctl_cmd *);
Petr Šabata fbed67
 };
Petr Šabata fbed67
 
Petr Šabata fbed67
-struct ndctl_dimm_ops * const intel_dimm_ops;
Petr Šabata fbed67
-struct ndctl_dimm_ops * const hpe1_dimm_ops;
Petr Šabata fbed67
-struct ndctl_dimm_ops * const msft_dimm_ops;
Petr Šabata fbed67
-struct ndctl_dimm_ops * const hyperv_dimm_ops;
Petr Šabata fbed67
+extern struct ndctl_dimm_ops * const intel_dimm_ops;
Petr Šabata fbed67
+extern struct ndctl_dimm_ops * const hpe1_dimm_ops;
Petr Šabata fbed67
+extern struct ndctl_dimm_ops * const msft_dimm_ops;
Petr Šabata fbed67
+extern struct ndctl_dimm_ops * const hyperv_dimm_ops;
Petr Šabata fbed67
 
Petr Šabata fbed67
 static inline struct ndctl_bus *cmd_to_bus(struct ndctl_cmd *cmd)
Petr Šabata fbed67
 {
Petr Šabata fbed67
diff --git a/ndctl/list.c b/ndctl/list.c
Petr Šabata fbed67
index 125a9fe..12d78d8 100644
Petr Šabata fbed67
--- a/ndctl/list.c
Petr Šabata fbed67
+++ b/ndctl/list.c
Petr Šabata fbed67
@@ -59,7 +59,7 @@ static unsigned long listopts_to_flags(void)
Petr Šabata fbed67
 	return flags;
Petr Šabata fbed67
 }
Petr Šabata fbed67
 
Petr Šabata fbed67
-struct util_filter_params param;
Petr Šabata fbed67
+static struct util_filter_params param;
Petr Šabata fbed67
 
Petr Šabata fbed67
 static int did_fail;
Petr Šabata fbed67
 
Petr Šabata fbed67
diff --git a/ndctl/monitor.c b/ndctl/monitor.c
Petr Šabata fbed67
index b8ee27f..1755b87 100644
Petr Šabata fbed67
--- a/ndctl/monitor.c
Petr Šabata fbed67
+++ b/ndctl/monitor.c
Petr Šabata fbed67
@@ -45,7 +45,7 @@ struct monitor_dimm {
Petr Šabata fbed67
 	struct list_node list;
Petr Šabata fbed67
 };
Petr Šabata fbed67
 
Petr Šabata fbed67
-struct util_filter_params param;
Petr Šabata fbed67
+static struct util_filter_params param;
Petr Šabata fbed67
 
Petr Šabata fbed67
 static int did_fail;
Petr Šabata fbed67
 
Petr Šabata fbed67
-- 
Petr Šabata fbed67
2.21.1
Petr Šabata fbed67