patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: stable@dpdk.org
Cc: david.hunt@intel.com, reshma.pattan@intel.com,
	thomas@monjalon.net, David Marchand <david.marchand@redhat.com>,
	Kevin Traynor <ktraynor@redhat.com>
Subject: [dpdk-stable] [PATCH 18.11 1/2] examples/vm_power: fix build with -fno-common
Date: Tue, 16 Jun 2020 16:17:12 +0100
Message-ID: <20200616151713.13128-2-ktraynor@redhat.com> (raw)
In-Reply-To: <20200616151713.13128-1-ktraynor@redhat.com>

From: Thomas Monjalon <thomas@monjalon.net>

[ upstream commit 96d3d532f9f2e42cf8b620ad3ba9da1f04ccb3f0 ]

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")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
---
 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 8aabd69c40..c53ad4bf1b 100644
--- a/examples/vm_power_manager/channel_manager.c
+++ b/examples/vm_power_manager/channel_manager.c
@@ -37,4 +37,6 @@
 		if ((mask_u64b >> i) & 1) \
 
+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 22905266f8..3c48d6ae66 100644
--- a/examples/vm_power_manager/channel_manager.h
+++ b/examples/vm_power_manager/channel_manager.h
@@ -44,5 +44,5 @@ struct libvirt_vm_info {
 };
 
-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,
-- 
2.21.3


  reply	other threads:[~2020-06-16 15:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16 15:17 [dpdk-stable] [PATCH 18.11 0/2] vm power example build fixes Kevin Traynor
2020-06-16 15:17 ` Kevin Traynor [this message]
2020-06-16 15:17 ` [dpdk-stable] [PATCH 18.11 2/2] examples/vm_power: fix build because of missing include Kevin Traynor
2020-06-17  9:16 ` [dpdk-stable] [PATCH 18.11 0/2] vm power example build fixes Luca Boccassi
2020-06-19  9:38   ` Kevin Traynor

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=20200616151713.13128-2-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=david.hunt@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=reshma.pattan@intel.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git