Message ID | b00ae7a3-cfd8-8ffc-ccf5-3a1a11a08365@redhat.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Delegated to: | Yuanhan Liu |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 01EAD2617; Tue, 26 Apr 2016 11:35:32 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 128F31BBE for <dev@dpdk.org>; Tue, 26 Apr 2016 11:35:31 +0200 (CEST) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DA69BC00F1DF; Tue, 26 Apr 2016 09:35:29 +0000 (UTC) Received: from sopuli.koti.laiskiainen.org (vpn1-5-6.ams2.redhat.com [10.36.5.6]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3Q9ZRRJ024643; Tue, 26 Apr 2016 05:35:28 -0400 To: Tetsuya Mukawa <mukawa@igel.co.jp>, dev@dpdk.org References: <571DDDD8.6000000@igel.co.jp> <1461649169-13967-1-git-send-email-mukawa@igel.co.jp> Cc: yuanhan.liu@linux.intel.com, huawei.xie@intel.com, Thomas Monjalon <thomas.monjalon@6wind.com> From: Panu Matilainen <pmatilai@redhat.com> Message-ID: <b00ae7a3-cfd8-8ffc-ccf5-3a1a11a08365@redhat.com> Date: Tue, 26 Apr 2016 12:35:27 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <1461649169-13967-1-git-send-email-mukawa@igel.co.jp> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Subject: Re: [dpdk-dev] [PATCH v2] vhost: Fix linkage of vhost PMD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Panu Matilainen
April 26, 2016, 9:35 a.m. UTC
On 04/26/2016 08:39 AM, 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> > --- > drivers/net/vhost/Makefile | 1 + > 1 file changed, 1 insertion(+) > > 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 > > Hmm, turns out this isn't quite enough, simply because its the first of its kind (first internal dependency between libraries), at least I'm getting: == Build drivers/net/vhost gcc -m64 -Wl,--version-script=/srv/work/dist/dpdk/dpdk-16.04/drivers/net/vhost/rte_pmd_vhost_version.map -shared rte_eth_vhost.o -lrte_vhost -Wl,-soname,librte_pmd_vhost.so.1 -o librte_pmd_vhost.so.1 /usr/bin/ld: cannot find -lrte_vhost collect2: error: ld returned 1 exit status /srv/work/dist/dpdk/dpdk-16.04/mk/rte.lib.mk:127: recipe for target 'librte_pmd_vhost.so.1' failed So it'll need something like this as a pre-requisite to add the internal libraries to the linker path: O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)"," LD $(@)") I can submit an official patch for this later but I'm not exactly feeling like the sharpest knife in the drawer today so if somebody beats me to it, feel free. - Panu -
Comments
On 2016/04/26 18:35, Panu Matilainen wrote: > On 04/26/2016 08:39 AM, 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> >> --- >> drivers/net/vhost/Makefile | 1 + >> 1 file changed, 1 insertion(+) >> >> 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 >> >> > > Hmm, turns out this isn't quite enough, simply because its the first > of its kind (first internal dependency between libraries), at least > I'm getting: > > == Build drivers/net/vhost > gcc -m64 > -Wl,--version-script=/srv/work/dist/dpdk/dpdk-16.04/drivers/net/vhost/rte_pmd_vhost_version.map > -shared rte_eth_vhost.o -lrte_vhost -Wl,-soname,librte_pmd_vhost.so.1 > -o librte_pmd_vhost.so.1 > /usr/bin/ld: cannot find -lrte_vhost > collect2: error: ld returned 1 exit status > /srv/work/dist/dpdk/dpdk-16.04/mk/rte.lib.mk:127: recipe for target > 'librte_pmd_vhost.so.1' failed > > So it'll need something like this as a pre-requisite to add the > internal libraries to the linker path: > > diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk > index 8f7e021..f5d7b04 100644 > --- a/mk/rte.lib.mk > +++ b/mk/rte.lib.mk > @@ -86,7 +86,7 @@ O_TO_A_DO = @set -e; \ > $(O_TO_A) && \ > echo $(O_TO_A_CMD) > $(call exe2cmd,$(@)) > > -O_TO_S = $(LD) $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS) -shared $(OBJS-y) > $(LDLIBS) \ > +O_TO_S = $(LD) -L$(RTE_OUTPUT)/lib $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS) > -shared $(OBJS-y) $(LDLIBS) \ > -Wl,-soname,$(LIB) -o $(LIB) > O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight > O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)"," LD $(@)") > > > I can submit an official patch for this later but I'm not exactly > feeling like the sharpest knife in the drawer today so if somebody > beats me to it, feel free. > > - Panu - Thanks for catching it. It seems I've already installed DPDK libraries in /usr/local/lib/. Then , I could not catch this error. I've confirmed your solution works fine. Thanks, Tetsuya
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk index 8f7e021..f5d7b04 100644 --- a/mk/rte.lib.mk +++ b/mk/rte.lib.mk @@ -86,7 +86,7 @@ O_TO_A_DO = @set -e; \ $(O_TO_A) && \ echo $(O_TO_A_CMD) > $(call exe2cmd,$(@)) -O_TO_S = $(LD) $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS) -shared $(OBJS-y) $(LDLIBS) \ +O_TO_S = $(LD) -L$(RTE_OUTPUT)/lib $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS) -shared $(OBJS-y) $(LDLIBS) \ -Wl,-soname,$(LIB) -o $(LIB) O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight