[dpdk-dev,v2] vhost: Fix linkage of vhost PMD

Message ID 1461649169-13967-1-git-send-email-mukawa@igel.co.jp (mailing list archive)
State Accepted, archived
Delegated to: Yuanhan Liu
Headers

Commit Message

Tetsuya Mukawa April 26, 2016, 5:39 a.m. UTC
  Currently, vhost PMD doesn't have linkage for librte_vhost, even though
it depends on librte_vhost APIs. This causes a linkage error if below
conditions are fulfilled.

 - DPDK libraries are compiled as shared libraries.
 - DPDK application doesn't link librte_vhost.
 - Above application tries to link vhost PMD using '-d' DPDK option.

The patch adds linkage for librte_vhost to vhost PMD not to cause an
above error.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
---
 drivers/net/vhost/Makefile | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Yuanhan Liu April 27, 2016, 10:21 p.m. UTC | #1
On Tue, Apr 26, 2016 at 02:39:29PM +0900, Tetsuya Mukawa wrote:
> Currently, vhost PMD doesn't have linkage for librte_vhost, even though
> it depends on librte_vhost APIs. This causes a linkage error if below
> conditions are fulfilled.
> 
>  - DPDK libraries are compiled as shared libraries.
>  - DPDK application doesn't link librte_vhost.
>  - Above application tries to link vhost PMD using '-d' DPDK option.
> 
> The patch adds linkage for librte_vhost to vhost PMD not to cause an
> above error.
> 
> Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
> Acked-by: Panu Matilainen <pmatilai@redhat.com>

Applied to dpdk-next-virtio.

Thanks.

	--yliu
  

Patch

diff --git a/drivers/net/vhost/Makefile b/drivers/net/vhost/Makefile
index f49a69b..30b91a0 100644
--- a/drivers/net/vhost/Makefile
+++ b/drivers/net/vhost/Makefile
@@ -38,6 +38,7 @@  LIB = librte_pmd_vhost.a
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+LDLIBS += -lrte_vhost
 
 EXPORT_MAP := rte_pmd_vhost_version.map