DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] net/virtio: fix build errors
@ 2019-07-30 11:04 jerinj
  2019-07-30 16:12 ` Maxime Coquelin
  0 siblings, 1 reply; 3+ messages in thread
From: jerinj @ 2019-07-30 11:04 UTC (permalink / raw)
  To: dev, Maxime Coquelin, Tiwei Bie, Zhihong Wang
  Cc: thomas, Jerin Jacob, Jianfeng Tan, stable

From: Jerin Jacob <jerinj@marvell.com>

Add extern to variable declaration to avoid some compiler treating it
as variable definition.

build error log:

lib/librte_pmd_virtio.a(vhost_kernel.o):(.rodata+0x110):
multiple definition of `vhost_msg_strings'
lib/librte_pmd_virtio.a(vhost_user.o):(.data.rel.ro.local+0x0):
first defined here
lib/librte_pmd_virtio.a(virtio_user_dev.o):(.rodata+0xe8):
multiple definition of `vhost_msg_strings'
lib/librte_pmd_virtio.a(vhost_user.o):(.data.rel.ro.local+0x0):
first defined here

Fixes: 33d24d65fe2b ("net/virtio-user: abstract backend operations")

Cc: Jianfeng Tan <jianfeng.tan@intel.com>
Cc: stable@dpdk.org

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/net/virtio/virtio_user/vhost.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_user/vhost.h b/drivers/net/virtio/virtio_user/vhost.h
index 55f47036b..1e784e58e 100644
--- a/drivers/net/virtio/virtio_user/vhost.h
+++ b/drivers/net/virtio/virtio_user/vhost.h
@@ -67,7 +67,7 @@ enum vhost_user_request {
 	VHOST_USER_MAX
 };
 
-const char * const vhost_msg_strings[VHOST_USER_MAX];
+extern const char * const vhost_msg_strings[VHOST_USER_MAX];
 
 struct vhost_memory_region {
 	uint64_t guest_phys_addr;
-- 
2.22.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-30 17:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-30 11:04 [dpdk-dev] [PATCH] net/virtio: fix build errors jerinj
2019-07-30 16:12 ` Maxime Coquelin
2019-07-30 17:47   ` Thomas Monjalon

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