* [dpdk-dev] [PATCH] examples: ethtool: Link against librte_pmd_ixgbe if necessary
@ 2017-02-16 16:17 Markos Chandras
2017-02-17 16:11 ` Remy Horton
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Markos Chandras @ 2017-02-16 16:17 UTC (permalink / raw)
To: dev; +Cc: Markos Chandras, Nirmoy Das
The librte_ethtool library depends on librte_pmd_ixgbe if that
pmd driver is enabled so we need to link against it when we compile
the ethtool application. It fixes the following build problem:
/usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/bin/ld:
warning: librte_pmd_ixgbe.so.1, needed by /home/abuild/rpmbuild/BUILD/
dpdk-17.02/examples/ethtool/lib/x86_64-native-linuxapp-gcc/lib/
librte_ethtool.so, not found (try using -rpath or -rpath-link)
/home/abuild/rpmbuild/BUILD/dpdk-17.02/examples/ethtool/lib/
x86_64-native-linuxapp-gcc/lib/librte_ethtool.so: undefined reference to
`rte_pmd_ixgbe_set_vf_rxmode@DPDK_17.02'
collect2: error: ld returned 1 exit status
Cc: Nirmoy Das <ndas@suse.de>
Signed-off-by: Markos Chandras <mchandras@suse.de>
---
examples/ethtool/ethtool-app/Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/examples/ethtool/ethtool-app/Makefile b/examples/ethtool/ethtool-app/Makefile
index 09c66ad19..9382ca7c3 100644
--- a/examples/ethtool/ethtool-app/Makefile
+++ b/examples/ethtool/ethtool-app/Makefile
@@ -50,5 +50,8 @@ CFLAGS += $(WERROR_FLAGS)
LDLIBS += -L$(subst ethtool-app,lib,$(RTE_OUTPUT))/lib
LDLIBS += -lrte_ethtool
+ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
+LDLIBS += -lrte_pmd_ixgbe
+endif
include $(RTE_SDK)/mk/rte.extapp.mk
--
2.11.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] examples: ethtool: Link against librte_pmd_ixgbe if necessary
2017-02-16 16:17 [dpdk-dev] [PATCH] examples: ethtool: Link against librte_pmd_ixgbe if necessary Markos Chandras
@ 2017-02-17 16:11 ` Remy Horton
2017-02-17 16:27 ` Markos Chandras
2017-04-07 13:15 ` Timothy M. Redaelli
2017-02-20 14:06 ` Remy Horton
` (2 subsequent siblings)
3 siblings, 2 replies; 11+ messages in thread
From: Remy Horton @ 2017-02-17 16:11 UTC (permalink / raw)
To: Markos Chandras, dev; +Cc: Nirmoy Das
On 16/02/2017 16:17, Markos Chandras wrote:
> The librte_ethtool library depends on librte_pmd_ixgbe if that
> pmd driver is enabled so we need to link against it when we compile
> the ethtool application. It fixes the following build problem:
For some reason this is not an issue with my Fedora box, so I'm guessing
SUSE is stricter with sub-depenencies of libraries. Does this affect any
of the OpenSUSE Linux distributions?
..Remy
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] examples: ethtool: Link against librte_pmd_ixgbe if necessary
2017-02-17 16:11 ` Remy Horton
@ 2017-02-17 16:27 ` Markos Chandras
2017-02-20 14:06 ` Remy Horton
2017-04-07 13:15 ` Timothy M. Redaelli
1 sibling, 1 reply; 11+ messages in thread
From: Markos Chandras @ 2017-02-17 16:27 UTC (permalink / raw)
To: Remy Horton, dev; +Cc: Nirmoy Das
On 02/17/2017 04:11 PM, Remy Horton wrote:
>
> On 16/02/2017 16:17, Markos Chandras wrote:
>> The librte_ethtool library depends on librte_pmd_ixgbe if that
>> pmd driver is enabled so we need to link against it when we compile
>> the ethtool application. It fixes the following build problem:
>
> For some reason this is not an issue with my Fedora box, so I'm guessing
> SUSE is stricter with sub-depenencies of libraries. Does this affect any
> of the OpenSUSE Linux distributions?
>
> ..Remy
Hi Remy,
Yeah I am seen this problem in the openSUSE Tumbleweed distribution. I
think Nirmoy may have seen that in openSUSE Leap but I will let him
confirm that.
--
markos
SUSE LINUX GmbH | GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg) Maxfeldstr. 5, D-90409, Nürnberg
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] examples: ethtool: Link against librte_pmd_ixgbe if necessary
2017-02-17 16:27 ` Markos Chandras
@ 2017-02-20 14:06 ` Remy Horton
0 siblings, 0 replies; 11+ messages in thread
From: Remy Horton @ 2017-02-20 14:06 UTC (permalink / raw)
To: Markos Chandras, dev; +Cc: Nirmoy Das
On 17/02/2017 16:27, Markos Chandras wrote:
> On 02/17/2017 04:11 PM, Remy Horton wrote:
[..]
> Yeah I am seen this problem in the openSUSE Tumbleweed distribution. I
> think Nirmoy may have seen that in openSUSE Leap but I will let him
> confirm that.
Tried Tumbleweed (version 13.3 I think) but haven't been able to
replicate the problem. Patch doesn't break anything so it seems OK for
it to go in.
..Remy
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] examples: ethtool: Link against librte_pmd_ixgbe if necessary
2017-02-17 16:11 ` Remy Horton
2017-02-17 16:27 ` Markos Chandras
@ 2017-04-07 13:15 ` Timothy M. Redaelli
1 sibling, 0 replies; 11+ messages in thread
From: Timothy M. Redaelli @ 2017-04-07 13:15 UTC (permalink / raw)
To: Remy Horton, Markos Chandras, dev; +Cc: Nirmoy Das
On 02/17/2017 05:11 PM, remy.horton at intel.com (Remy Horton) wrote:
>
> On 16/02/2017 16:17, Markos Chandras wrote:
>> The librte_ethtool library depends on librte_pmd_ixgbe if that
>> pmd driver is enabled so we need to link against it when we compile
>> the ethtool application. It fixes the following build problem:
>
> For some reason this is not an issue with my Fedora box, so I'm guessing
> SUSE is stricter with sub-depenencies of libraries. Does this affect any
> of the OpenSUSE Linux distributions?
Hi,
I found that the issue is only present if you compile *without* .git
directory present.
If you have .git directoy RTE_DEVEL_BUILD is set to y (see
mk/rte.var.mk) and this adds -rpath=$(RTE_SDK_BIN)/lib (see
mk/rte.app.mk) that "hides" the problem, since the linker finds
"librte_pmd_ixgbe.so" inside the $(RTE_SDK_BIN)/lib directory.
So if you want to replicate it, you can delete the .git directory, use a
snapshot (for example http://dpdk.org/browse/dpdk/snapshot/master.tar.xz
or http://dpdk.org/browse/dpdk/snapshot/dpdk-17.05-rc1.tar.xz) or export
RTE_DEVEL_BUILD=n.
I confirm that this commit fixes the problem.
Obliviously the problem is *only* present while using shared libraries.
Acked-by: Timothy Redaelli <tredaelli@redhat.com>
You may use the following commands to replicate the problem:
--8<--------------------------cut here-------------------------->8--
unset RTE_SDK RTE_INCLUDE RTE_TARGET
export RTE_DEVEL_BUILD=n
rm -rf x86_64-native-linuxapp-gcc
make O=x86_64-native-linuxapp-gcc T=x86_64-native-linuxapp-gcc
-j$(nproc) config
sed -i 's/CONFIG_RTE_BUILD_SHARED_LIB=n/CONFIG_RTE_BUILD_SHARED_LIB=y/'
x86_64-native-linuxapp-gcc/.config
make O=x86_64-native-linuxapp-gcc -j$(nproc)
make O=x86_64-native-linuxapp-gcc/examples T=x86_64-native-linuxapp-gcc
examples
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] examples: ethtool: Link against librte_pmd_ixgbe if necessary
2017-02-16 16:17 [dpdk-dev] [PATCH] examples: ethtool: Link against librte_pmd_ixgbe if necessary Markos Chandras
2017-02-17 16:11 ` Remy Horton
@ 2017-02-20 14:06 ` Remy Horton
2017-03-09 20:13 ` Thomas Monjalon
2017-05-01 20:10 ` [dpdk-dev] [PATCH v2] examples/ethtool: fix link with ixgbe shared lib Thomas Monjalon
3 siblings, 0 replies; 11+ messages in thread
From: Remy Horton @ 2017-02-20 14:06 UTC (permalink / raw)
To: Markos Chandras, dev; +Cc: Nirmoy Das
On 16/02/2017 16:17, Markos Chandras wrote:
[..]
> Cc: Nirmoy Das <ndas@suse.de>
> Signed-off-by: Markos Chandras <mchandras@suse.de>
Acked-by: Remy Horton <remy.horton@intel.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] examples: ethtool: Link against librte_pmd_ixgbe if necessary
2017-02-16 16:17 [dpdk-dev] [PATCH] examples: ethtool: Link against librte_pmd_ixgbe if necessary Markos Chandras
2017-02-17 16:11 ` Remy Horton
2017-02-20 14:06 ` Remy Horton
@ 2017-03-09 20:13 ` Thomas Monjalon
2017-04-04 10:15 ` Thomas Monjalon
2017-05-01 20:10 ` [dpdk-dev] [PATCH v2] examples/ethtool: fix link with ixgbe shared lib Thomas Monjalon
3 siblings, 1 reply; 11+ messages in thread
From: Thomas Monjalon @ 2017-03-09 20:13 UTC (permalink / raw)
To: Markos Chandras; +Cc: dev, Nirmoy Das, Iremonger, Bernard, Remy Horton
2017-02-16 16:17, Markos Chandras:
> The librte_ethtool library depends on librte_pmd_ixgbe if that
> pmd driver is enabled so we need to link against it when we compile
> the ethtool application. It fixes the following build problem:
>
> /usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/bin/ld:
> warning: librte_pmd_ixgbe.so.1, needed by /home/abuild/rpmbuild/BUILD/
> dpdk-17.02/examples/ethtool/lib/x86_64-native-linuxapp-gcc/lib/
> librte_ethtool.so, not found (try using -rpath or -rpath-link)
> /home/abuild/rpmbuild/BUILD/dpdk-17.02/examples/ethtool/lib/
> x86_64-native-linuxapp-gcc/lib/librte_ethtool.so: undefined reference to
> `rte_pmd_ixgbe_set_vf_rxmode@DPDK_17.02'
> collect2: error: ld returned 1 exit status
We may add this line:
Fixes: 077d223e25c3 ("examples/ethtool: use ixgbe public function")
> Cc: Nirmoy Das <ndas@suse.de>
> Signed-off-by: Markos Chandras <mchandras@suse.de>
[...]
> --- a/examples/ethtool/ethtool-app/Makefile
> +++ b/examples/ethtool/ethtool-app/Makefile
> +ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
> +LDLIBS += -lrte_pmd_ixgbe
> +endif
Please, could you confirm we can remove the same LDLIBS line from
examples/ethtool/lib/Makefile ?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] examples: ethtool: Link against librte_pmd_ixgbe if necessary
2017-03-09 20:13 ` Thomas Monjalon
@ 2017-04-04 10:15 ` Thomas Monjalon
2017-04-04 11:12 ` Remy Horton
0 siblings, 1 reply; 11+ messages in thread
From: Thomas Monjalon @ 2017-04-04 10:15 UTC (permalink / raw)
To: Markos Chandras; +Cc: dev, Nirmoy Das, Iremonger, Bernard, Remy Horton
Ping
2017-03-09 21:13, Thomas Monjalon:
> 2017-02-16 16:17, Markos Chandras:
> > The librte_ethtool library depends on librte_pmd_ixgbe if that
> > pmd driver is enabled so we need to link against it when we compile
> > the ethtool application. It fixes the following build problem:
> >
> > /usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/bin/ld:
> > warning: librte_pmd_ixgbe.so.1, needed by /home/abuild/rpmbuild/BUILD/
> > dpdk-17.02/examples/ethtool/lib/x86_64-native-linuxapp-gcc/lib/
> > librte_ethtool.so, not found (try using -rpath or -rpath-link)
> > /home/abuild/rpmbuild/BUILD/dpdk-17.02/examples/ethtool/lib/
> > x86_64-native-linuxapp-gcc/lib/librte_ethtool.so: undefined reference to
> > `rte_pmd_ixgbe_set_vf_rxmode@DPDK_17.02'
> > collect2: error: ld returned 1 exit status
>
> We may add this line:
> Fixes: 077d223e25c3 ("examples/ethtool: use ixgbe public function")
>
> > Cc: Nirmoy Das <ndas@suse.de>
> > Signed-off-by: Markos Chandras <mchandras@suse.de>
> [...]
> > --- a/examples/ethtool/ethtool-app/Makefile
> > +++ b/examples/ethtool/ethtool-app/Makefile
> > +ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
> > +LDLIBS += -lrte_pmd_ixgbe
> > +endif
>
> Please, could you confirm we can remove the same LDLIBS line from
> examples/ethtool/lib/Makefile ?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH] examples: ethtool: Link against librte_pmd_ixgbe if necessary
2017-04-04 10:15 ` Thomas Monjalon
@ 2017-04-04 11:12 ` Remy Horton
0 siblings, 0 replies; 11+ messages in thread
From: Remy Horton @ 2017-04-04 11:12 UTC (permalink / raw)
To: Thomas Monjalon, Markos Chandras; +Cc: dev, Nirmoy Das, Iremonger, Bernard
On 04/04/2017 11:15, Thomas Monjalon wrote:
> Ping
[..]
>>> --- a/examples/ethtool/ethtool-app/Makefile
>>> +++ b/examples/ethtool/ethtool-app/Makefile
>>> +ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
>>> +LDLIBS += -lrte_pmd_ixgbe
>>> +endif
>>
>> Please, could you confirm we can remove the same LDLIBS line from
>> examples/ethtool/lib/Makefile ?
Did a quick smoke test and looks like it needs to be in lib/Makefile as
well, at least for shared builds on Fedora. Not sure why though..
[ ethtool]$ make
== lib
LD librte_ethtool.so.1
rte_ethtool.o: In function `rte_ethtool_net_set_rx_mode':
rte_ethtool.c:(.text+0x667): undefined reference to
`rte_pmd_ixgbe_set_vf_rxmode'
collect2: error: ld returned 1 exit status
^ permalink raw reply [flat|nested] 11+ messages in thread
* [dpdk-dev] [PATCH v2] examples/ethtool: fix link with ixgbe shared lib
2017-02-16 16:17 [dpdk-dev] [PATCH] examples: ethtool: Link against librte_pmd_ixgbe if necessary Markos Chandras
` (2 preceding siblings ...)
2017-03-09 20:13 ` Thomas Monjalon
@ 2017-05-01 20:10 ` Thomas Monjalon
2017-05-01 20:12 ` Thomas Monjalon
3 siblings, 1 reply; 11+ messages in thread
From: Thomas Monjalon @ 2017-05-01 20:10 UTC (permalink / raw)
To: Markos Chandras; +Cc: dev
From: Markos Chandras <mchandras@suse.de>
When RTE_DEVEL_BUILD is unset, -rpath is unset.
So the ethtool app cannot link with ixgbe shared library
which is required by ethtool lib:
warning: librte_pmd_ixgbe.so.1, needed by
examples/ethtool/lib/x86_64-native-linuxapp-gcc/lib/librte_ethtool.so,
not found (try using -rpath or -rpath-link)
It is fixed by adding the library in the application link.
The library link is also improved to specify that this explicit link
to ixgbe is needed only in the shared lib mode.
Fixes: 077d223e25c3 ("examples/ethtool: use ixgbe public function")
Signed-off-by: Markos Chandras <mchandras@suse.de>
Acked-by: Remy Horton <remy.horton@intel.com>
Acked-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
v2: add condition on CONFIG_RTE_BUILD_SHARED_LIB
---
examples/ethtool/ethtool-app/Makefile | 5 +++++
examples/ethtool/lib/Makefile | 2 ++
2 files changed, 7 insertions(+)
diff --git a/examples/ethtool/ethtool-app/Makefile b/examples/ethtool/ethtool-app/Makefile
index 09c66ad19..96abf53b2 100644
--- a/examples/ethtool/ethtool-app/Makefile
+++ b/examples/ethtool/ethtool-app/Makefile
@@ -50,5 +50,10 @@ CFLAGS += $(WERROR_FLAGS)
LDLIBS += -L$(subst ethtool-app,lib,$(RTE_OUTPUT))/lib
LDLIBS += -lrte_ethtool
+ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
+ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
+LDLIBS += -lrte_pmd_ixgbe
+endif
+endif
include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/ethtool/lib/Makefile b/examples/ethtool/lib/Makefile
index 197c1d6f5..266babade 100644
--- a/examples/ethtool/lib/Makefile
+++ b/examples/ethtool/lib/Makefile
@@ -54,8 +54,10 @@ SRCS-y := rte_ethtool.c
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
+ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
LDLIBS += -lrte_pmd_ixgbe
endif
+endif
include $(RTE_SDK)/mk/rte.extlib.mk
--
2.12.2
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH v2] examples/ethtool: fix link with ixgbe shared lib
2017-05-01 20:10 ` [dpdk-dev] [PATCH v2] examples/ethtool: fix link with ixgbe shared lib Thomas Monjalon
@ 2017-05-01 20:12 ` Thomas Monjalon
0 siblings, 0 replies; 11+ messages in thread
From: Thomas Monjalon @ 2017-05-01 20:12 UTC (permalink / raw)
To: Markos Chandras; +Cc: dev, Remy Horton, Timothy Redaelli
01/05/2017 22:10, Thomas Monjalon:
> From: Markos Chandras <mchandras@suse.de>
>
> When RTE_DEVEL_BUILD is unset, -rpath is unset.
> So the ethtool app cannot link with ixgbe shared library
> which is required by ethtool lib:
>
> warning: librte_pmd_ixgbe.so.1, needed by
> examples/ethtool/lib/x86_64-native-linuxapp-gcc/lib/librte_ethtool.so,
> not found (try using -rpath or -rpath-link)
>
> It is fixed by adding the library in the application link.
>
> The library link is also improved to specify that this explicit link
> to ixgbe is needed only in the shared lib mode.
>
> Fixes: 077d223e25c3 ("examples/ethtool: use ixgbe public function")
>
> Signed-off-by: Markos Chandras <mchandras@suse.de>
> Acked-by: Remy Horton <remy.horton@intel.com>
> Acked-by: Timothy Redaelli <tredaelli@redhat.com>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> v2: add condition on CONFIG_RTE_BUILD_SHARED_LIB
Applied, thanks
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2017-05-01 20:12 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-16 16:17 [dpdk-dev] [PATCH] examples: ethtool: Link against librte_pmd_ixgbe if necessary Markos Chandras
2017-02-17 16:11 ` Remy Horton
2017-02-17 16:27 ` Markos Chandras
2017-02-20 14:06 ` Remy Horton
2017-04-07 13:15 ` Timothy M. Redaelli
2017-02-20 14:06 ` Remy Horton
2017-03-09 20:13 ` Thomas Monjalon
2017-04-04 10:15 ` Thomas Monjalon
2017-04-04 11:12 ` Remy Horton
2017-05-01 20:10 ` [dpdk-dev] [PATCH v2] examples/ethtool: fix link with ixgbe shared lib Thomas Monjalon
2017-05-01 20:12 ` 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).