examples/vm_power: fix build with -fno-common
authorThomas Monjalon <thomas@monjalon.net>
Wed, 20 May 2020 07:59:35 +0000 (09:59 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 21 May 2020 13:41:48 +0000 (15:41 +0200)
commit96d3d532f9f2e42cf8b620ad3ba9da1f04ccb3f0
tree0435e6595d8ca874ddf5de88fe8b45d9e8d3e2d0
parent7f55a2053b908ff08a8a2d1cc8d4d927923d52f7
examples/vm_power: fix build with -fno-common

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>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
examples/vm_power_manager/channel_manager.c
examples/vm_power_manager/channel_manager.h