From: Tetsuya Mukawa <mukawa@igel.co.jp>
To: Panu Matilainen <pmatilai@redhat.com>, dev@dpdk.org
Cc: yuanhan.liu@linux.intel.com, huawei.xie@intel.com,
Thomas Monjalon <thomas.monjalon@6wind.com>
Subject: Re: [PATCH v2] vhost: Fix linkage of vhost PMD
Date: Wed, 27 Apr 2016 10:38:46 +0900 [thread overview]
Message-ID: <57201826.30504@igel.co.jp> (raw)
In-Reply-To: <b00ae7a3-cfd8-8ffc-ccf5-3a1a11a08365@redhat.com>
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
next prev parent reply other threads:[~2016-04-27 1:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-25 9:05 [RFC] Link ibrte_vhost to librte_pmd_vhost Tetsuya Mukawa
2016-04-25 9:28 ` Panu Matilainen
2016-04-25 9:44 ` Tetsuya Mukawa
2016-04-26 3:47 ` Yuanhan Liu
2016-04-26 5:37 ` Tetsuya Mukawa
2016-04-26 5:48 ` Yuanhan Liu
2016-04-26 6:00 ` Tetsuya Mukawa
2016-04-26 5:39 ` [PATCH v2] vhost: Fix linkage of vhost PMD Tetsuya Mukawa
2016-04-26 9:35 ` Panu Matilainen
2016-04-27 1:38 ` Tetsuya Mukawa [this message]
2016-04-27 22:21 ` Yuanhan Liu
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=57201826.30504@igel.co.jp \
--to=mukawa@igel.co.jp \
--cc=dev@dpdk.org \
--cc=huawei.xie@intel.com \
--cc=pmatilai@redhat.com \
--cc=thomas.monjalon@6wind.com \
--cc=yuanhan.liu@linux.intel.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.