From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: david.marchand@redhat.com, stable@dpdk.org,
David Hunt <david.hunt@intel.com>,
Nemanja Marjanovic <nemanja.marjanovic@intel.com>,
Rory Sexton <rory.sexton@intel.com>,
Santosh Shukla <santosh.shukla@caviumnetworks.com>,
Konstantin Ananyev <konstantin.ananyev@intel.com>
Subject: [dpdk-dev] [PATCH 2/4] examples/vm_power: fix build with -fno-common
Date: Wed, 20 May 2020 15:58:28 +0200 [thread overview]
Message-ID: <20200520135830.1178242-3-thomas@monjalon.net> (raw)
In-Reply-To: <20200520135830.1178242-1-thomas@monjalon.net>
The variables of the same name are merged together
if compiled with -fcommon. It used to be the default.
This default behaviour allows to declare a variable in a header file and
share the variable in every .o binaries thanks to merge at link-time.
If compiling with -fno-common (default in GCC 10), the variable must be
shared as extern to avoid multiple re-definitions.
Fixes: dff22404aaad ("examples/vm_power_mgr: add VCPU to PCPU mapping")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
examples/vm_power_manager/channel_manager.c | 2 ++
examples/vm_power_manager/channel_manager.h | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c
index 4ac21f02c1..4d13697208 100644
--- a/examples/vm_power_manager/channel_manager.c
+++ b/examples/vm_power_manager/channel_manager.c
@@ -35,6 +35,8 @@
#define RTE_LOGTYPE_CHANNEL_MANAGER RTE_LOGTYPE_USER1
+struct libvirt_vm_info lvm_info[MAX_CLIENTS];
+
/* Global pointer to libvirt connection */
static virConnectPtr global_vir_conn_ptr;
diff --git a/examples/vm_power_manager/channel_manager.h b/examples/vm_power_manager/channel_manager.h
index 8284be0a18..a2a2f2bba0 100644
--- a/examples/vm_power_manager/channel_manager.h
+++ b/examples/vm_power_manager/channel_manager.h
@@ -41,7 +41,7 @@ struct libvirt_vm_info {
uint8_t num_cpus;
};
-struct libvirt_vm_info lvm_info[MAX_CLIENTS];
+extern struct libvirt_vm_info lvm_info[MAX_CLIENTS];
/* Communication Channel Status */
enum channel_status { CHANNEL_MGR_CHANNEL_DISCONNECTED = 0,
CHANNEL_MGR_CHANNEL_CONNECTED,
--
2.26.2
next prev parent reply other threads:[~2020-05-20 13:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 13:58 [dpdk-dev] [PATCH 0/4] fix build with GCC 10 Thomas Monjalon
2020-05-20 13:58 ` [dpdk-dev] [PATCH 1/4] net/mvpp2: fix build with gcc 10 Thomas Monjalon
2020-05-20 14:05 ` [dpdk-dev] [EXT] " Liron Himi
2020-05-20 13:58 ` Thomas Monjalon [this message]
2020-05-20 13:58 ` [dpdk-dev] [PATCH 3/4] examples/vm_power: drop Unix path limit redefinition Thomas Monjalon
2020-05-20 13:58 ` [dpdk-dev] [PATCH 4/4] devtools: allow warnings in ABI reference build Thomas Monjalon
2020-05-20 14:52 ` [dpdk-dev] [PATCH 0/4] fix build with GCC 10 David Marchand
2020-05-20 16:45 ` Kevin Traynor
2020-05-21 13:39 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200520135830.1178242-3-thomas@monjalon.net \
--to=thomas@monjalon.net \
--cc=david.hunt@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@intel.com \
--cc=nemanja.marjanovic@intel.com \
--cc=rory.sexton@intel.com \
--cc=santosh.shukla@caviumnetworks.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).