[dpdk-dev,2/2] net: fix build error

Message ID 1516245283-23990-2-git-send-email-yliu@fridaylinux.org (mailing list archive)
State Accepted, archived
Delegated to: Yuanhan Liu
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Yuanhan Liu Jan. 18, 2018, 3:14 a.m. UTC
  Fix build error when shared lib is enabled:

  LD librte_net.so.1.1
rte_arp.o: In function `rte_net_make_rarp_packet':
rte_arp.c:(.text+0x1f0): undefined reference to `rte_mempool_ops_table'
rte_arp.c:(.text+0x21d): undefined reference to `rte_mempool_ops_table'
rte_arp.c:(.text+0x2d5): undefined reference to `rte_mempool_ops_table'
rte_arp.c:(.text+0x384): undefined reference to `rte_mempool_ops_table'
rte_arp.c:(.text+0x4b7): undefined reference to `rte_mempool_ops_table'

Fixes: 45ae05df824c ("net: add a helper for making RARP packet")

Signed-off-by: Yuanhan Liu <yliu@fridaylinux.org>
---
 lib/librte_net/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Jan. 18, 2018, 7:38 a.m. UTC | #1
18/01/2018 04:14, Yuanhan Liu:
> Fix build error when shared lib is enabled:
> 
>   LD librte_net.so.1.1
> rte_arp.o: In function `rte_net_make_rarp_packet':
> rte_arp.c:(.text+0x1f0): undefined reference to `rte_mempool_ops_table'
> rte_arp.c:(.text+0x21d): undefined reference to `rte_mempool_ops_table'
> rte_arp.c:(.text+0x2d5): undefined reference to `rte_mempool_ops_table'
> rte_arp.c:(.text+0x384): undefined reference to `rte_mempool_ops_table'
> rte_arp.c:(.text+0x4b7): undefined reference to `rte_mempool_ops_table'

This is very strange, I do not see this error on my machine.
  
Xiao Wang Jan. 18, 2018, 7:45 a.m. UTC | #2
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Thursday, January 18, 2018 3:39 PM
> To: Yuanhan Liu <yliu@fridaylinux.org>
> Cc: dev@dpdk.org; Wang, Xiao W <xiao.w.wang@intel.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>; Olivier Matz <olivier.matz@6wind.com>
> Subject: Re: [PATCH 2/2] net: fix build error
> 
> 18/01/2018 04:14, Yuanhan Liu:
> > Fix build error when shared lib is enabled:
> >
> >   LD librte_net.so.1.1
> > rte_arp.o: In function `rte_net_make_rarp_packet':
> > rte_arp.c:(.text+0x1f0): undefined reference to `rte_mempool_ops_table'
> > rte_arp.c:(.text+0x21d): undefined reference to `rte_mempool_ops_table'
> > rte_arp.c:(.text+0x2d5): undefined reference to `rte_mempool_ops_table'
> > rte_arp.c:(.text+0x384): undefined reference to `rte_mempool_ops_table'
> > rte_arp.c:(.text+0x4b7): undefined reference to `rte_mempool_ops_table'
> 
> This is very strange, I do not see this error on my machine.

I could see this error on mine with:
+CONFIG_RTE_BUILD_SHARED_LIB=y

And this fix helps.

Best Regards,
Xiao
  
Yuanhan Liu Jan. 18, 2018, 8:03 a.m. UTC | #3
On Thu, Jan 18, 2018 at 07:45:23AM +0000, Wang, Xiao W wrote:
> 
> 
> > -----Original Message-----
> > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > Sent: Thursday, January 18, 2018 3:39 PM
> > To: Yuanhan Liu <yliu@fridaylinux.org>
> > Cc: dev@dpdk.org; Wang, Xiao W <xiao.w.wang@intel.com>; Yigit, Ferruh
> > <ferruh.yigit@intel.com>; Olivier Matz <olivier.matz@6wind.com>
> > Subject: Re: [PATCH 2/2] net: fix build error
> > 
> > 18/01/2018 04:14, Yuanhan Liu:
> > > Fix build error when shared lib is enabled:
> > >
> > >   LD librte_net.so.1.1
> > > rte_arp.o: In function `rte_net_make_rarp_packet':
> > > rte_arp.c:(.text+0x1f0): undefined reference to `rte_mempool_ops_table'
> > > rte_arp.c:(.text+0x21d): undefined reference to `rte_mempool_ops_table'
> > > rte_arp.c:(.text+0x2d5): undefined reference to `rte_mempool_ops_table'
> > > rte_arp.c:(.text+0x384): undefined reference to `rte_mempool_ops_table'
> > > rte_arp.c:(.text+0x4b7): undefined reference to `rte_mempool_ops_table'
> > 
> > This is very strange, I do not see this error on my machine.
> 
> I could see this error on mine with:
> +CONFIG_RTE_BUILD_SHARED_LIB=y

Yes, that's what meant in the commit log by "when shared lib is enabled".

	--yliu
  
Thomas Monjalon Jan. 18, 2018, 8:36 a.m. UTC | #4
18/01/2018 09:03, Yuanhan Liu:
> On Thu, Jan 18, 2018 at 07:45:23AM +0000, Wang, Xiao W wrote:
> > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > > 18/01/2018 04:14, Yuanhan Liu:
> > > > Fix build error when shared lib is enabled:
> > > >
> > > >   LD librte_net.so.1.1
> > > > rte_arp.o: In function `rte_net_make_rarp_packet':
> > > > rte_arp.c:(.text+0x1f0): undefined reference to `rte_mempool_ops_table'
> > > > rte_arp.c:(.text+0x21d): undefined reference to `rte_mempool_ops_table'
> > > > rte_arp.c:(.text+0x2d5): undefined reference to `rte_mempool_ops_table'
> > > > rte_arp.c:(.text+0x384): undefined reference to `rte_mempool_ops_table'
> > > > rte_arp.c:(.text+0x4b7): undefined reference to `rte_mempool_ops_table'
> > > 
> > > This is very strange, I do not see this error on my machine.
> > 
> > I could see this error on mine with:
> > +CONFIG_RTE_BUILD_SHARED_LIB=y
> 
> Yes, that's what meant in the commit log by "when shared lib is enabled".

Got it: you are fixing a build issue introduced by the patch 1
in this series.
So please merge them.
  
Yuanhan Liu Jan. 18, 2018, 8:48 a.m. UTC | #5
On Thu, Jan 18, 2018 at 09:36:46AM +0100, Thomas Monjalon wrote:
> 18/01/2018 09:03, Yuanhan Liu:
> > On Thu, Jan 18, 2018 at 07:45:23AM +0000, Wang, Xiao W wrote:
> > > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > > > 18/01/2018 04:14, Yuanhan Liu:
> > > > > Fix build error when shared lib is enabled:
> > > > >
> > > > >   LD librte_net.so.1.1
> > > > > rte_arp.o: In function `rte_net_make_rarp_packet':
> > > > > rte_arp.c:(.text+0x1f0): undefined reference to `rte_mempool_ops_table'
> > > > > rte_arp.c:(.text+0x21d): undefined reference to `rte_mempool_ops_table'
> > > > > rte_arp.c:(.text+0x2d5): undefined reference to `rte_mempool_ops_table'
> > > > > rte_arp.c:(.text+0x384): undefined reference to `rte_mempool_ops_table'
> > > > > rte_arp.c:(.text+0x4b7): undefined reference to `rte_mempool_ops_table'
> > > > 
> > > > This is very strange, I do not see this error on my machine.
> > > 
> > > I could see this error on mine with:
> > > +CONFIG_RTE_BUILD_SHARED_LIB=y
> > 
> > Yes, that's what meant in the commit log by "when shared lib is enabled".
> 
> Got it: you are fixing a build issue introduced by the patch 1
> in this series.
> So please merge them.

Right. I will merge them.

	--yliu
  

Patch

diff --git a/lib/librte_net/Makefile b/lib/librte_net/Makefile
index ab290c3..95ff549 100644
--- a/lib/librte_net/Makefile
+++ b/lib/librte_net/Makefile
@@ -6,7 +6,7 @@  include $(RTE_SDK)/mk/rte.vars.mk
 LIB = librte_net.a
 
 CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
-LDLIBS += -lrte_mbuf -lrte_eal
+LDLIBS += -lrte_mbuf -lrte_eal -lrte_mempool
 
 EXPORT_MAP := rte_net_version.map
 LIBABIVER := 1