From bf704308f01fe8ff4d0a53da7b9905c5dbe909dd Mon Sep 17 00:00:00 2001
From: Nirmoy Das <ndas@suse.de>
Date: Thu, 26 Jul 2018 13:52:49 +0200
Subject: [PATCH] add missing library refs

---
 drivers/net/af_packet/Makefile | 2 +-
 drivers/net/bnx2x/Makefile     | 2 +-
 drivers/net/bonding/Makefile   | 2 +-
 drivers/net/cxgbe/Makefile     | 2 +-
 drivers/net/e1000/Makefile     | 2 +-
 drivers/net/enic/Makefile      | 2 +-
 drivers/net/fm10k/Makefile     | 2 +-
 drivers/net/i40e/Makefile      | 2 +-
 drivers/net/ixgbe/Makefile     | 2 +-
 drivers/net/mlx4/Makefile      | 2 ++
 drivers/net/mlx5/Makefile      | 1 +
 drivers/net/mpipe/Makefile     | 2 +-
 drivers/net/nfp/Makefile       | 2 +-
 drivers/net/null/Makefile      | 2 +-
 drivers/net/pcap/Makefile      | 2 +-
 drivers/net/ring/Makefile      | 2 +-
 drivers/net/szedata2/Makefile  | 2 +-
 drivers/net/virtio/Makefile    | 2 +-
 drivers/net/vmxnet3/Makefile   | 2 +-
 drivers/net/xenvirt/Makefile   | 2 +-
 mk/rte.lib.mk                  | 2 +-
 21 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/drivers/net/af_packet/Makefile b/drivers/net/af_packet/Makefile
index ce5d239..b2e16fa 100644
--- a/drivers/net/af_packet/Makefile
+++ b/drivers/net/af_packet/Makefile
@@ -39,7 +39,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 LIB = librte_pmd_af_packet.a
 
 EXPORT_MAP := rte_pmd_af_packet_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_kvargs
 LIBABIVER := 1
 
 CFLAGS += -O3
diff --git a/drivers/net/bnx2x/Makefile b/drivers/net/bnx2x/Makefile
index 6f1f385..c79ddf9 100644
--- a/drivers/net/bnx2x/Makefile
+++ b/drivers/net/bnx2x/Makefile
@@ -11,7 +11,7 @@ CFLAGS += -DZLIB_CONST
 LDLIBS += -lz
 
 EXPORT_MAP := rte_pmd_bnx2x_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_eal -lrte_mempool -lrte_hash
 LIBABIVER := 1
 
 #
diff --git a/drivers/net/bonding/Makefile b/drivers/net/bonding/Makefile
index 10c794c..f13da6b 100644
--- a/drivers/net/bonding/Makefile
+++ b/drivers/net/bonding/Makefile
@@ -40,7 +40,7 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
 EXPORT_MAP := rte_eth_bond_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_eal -lrte_kvargs -lrte_cmdline
 LIBABIVER := 1
 
 #
diff --git a/drivers/net/cxgbe/Makefile b/drivers/net/cxgbe/Makefile
index 0711976..de807e9 100644
--- a/drivers/net/cxgbe/Makefile
+++ b/drivers/net/cxgbe/Makefile
@@ -42,7 +42,7 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
 EXPORT_MAP := rte_pmd_cxgbe_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_eal -lrte_mempool 
 LIBABIVER := 1
 
 ifeq ($(CC), icc)
diff --git a/drivers/net/e1000/Makefile b/drivers/net/e1000/Makefile
index ccd2b7b..3263792 100644
--- a/drivers/net/e1000/Makefile
+++ b/drivers/net/e1000/Makefile
@@ -40,7 +40,7 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
 EXPORT_MAP := rte_pmd_e1000_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_eal -lrte_mempool
 LIBABIVER := 1
 
 ifeq ($(CC), icc)
diff --git a/drivers/net/enic/Makefile b/drivers/net/enic/Makefile
index f0ee093..0c5dcb4 100644
--- a/drivers/net/enic/Makefile
+++ b/drivers/net/enic/Makefile
@@ -38,7 +38,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 LIB = librte_pmd_enic.a
 
 EXPORT_MAP := rte_pmd_enic_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_eal -lrte_mempool -lrte_hash
 LIBABIVER := 1
 
 CFLAGS += -I$(SRCDIR)/base/
diff --git a/drivers/net/fm10k/Makefile b/drivers/net/fm10k/Makefile
index 602a2d2..92cac81 100644
--- a/drivers/net/fm10k/Makefile
+++ b/drivers/net/fm10k/Makefile
@@ -40,7 +40,7 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
 EXPORT_MAP := rte_pmd_fm10k_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_eal -lrte_mempool
 LIBABIVER := 1
 
 ifeq ($(CC), icc)
diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile
index 033ee4a..8b7d7f6 100644
--- a/drivers/net/i40e/Makefile
+++ b/drivers/net/i40e/Makefile
@@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) -DPF_DRIVER -DVF_DRIVER -DINTEGRATED_VF
 CFLAGS += -DX722_SUPPORT -DX722_A0_SUPPORT
 
 EXPORT_MAP := rte_pmd_i40e_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_eal -lrte_mempool
 LIBABIVER := 1
 
 #
diff --git a/drivers/net/ixgbe/Makefile b/drivers/net/ixgbe/Makefile
index c032775..6bd5a57 100644
--- a/drivers/net/ixgbe/Makefile
+++ b/drivers/net/ixgbe/Makefile
@@ -40,7 +40,7 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
 EXPORT_MAP := rte_pmd_ixgbe_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_eal -lrte_mempool
 LIBABIVER := 1
 
 ifeq ($(CC), icc)
diff --git a/drivers/net/mlx4/Makefile b/drivers/net/mlx4/Makefile
index 23b766d..fae1f84 100644
--- a/drivers/net/mlx4/Makefile
+++ b/drivers/net/mlx4/Makefile
@@ -40,6 +40,8 @@ endif
 # Library name.
 LIB = librte_pmd_mlx4.a
 
+LDLIBS += -lrte_mbuf -lethdev -lrte_eal -lrte_mempool
+
 # Sources.
 SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4.c
 
diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index ae568e6..6def06e 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -72,6 +72,7 @@ LDLIBS += -libverbs
 CFLAGS += -Wno-error=cast-qual
 
 EXPORT_MAP := rte_pmd_mlx5_version.map
+LDLIBS += -lrte_mbuf -lethdev -lrte_eal -lrte_mempool
 LIBABIVER := 1
 
 # DEBUG which is usually provided on the command-line may enable
diff --git a/drivers/net/mpipe/Makefile b/drivers/net/mpipe/Makefile
index 46f046d..aad6087 100644
--- a/drivers/net/mpipe/Makefile
+++ b/drivers/net/mpipe/Makefile
@@ -35,7 +35,7 @@ CFLAGS += $(WERROR_FLAGS) -O3
 LDLIBS += -lgxio
 
 EXPORT_MAP := rte_pmd_mpipe_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_eal -lrte_mempool
 LIBABIVER := 1
 
 SRCS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += mpipe_tilegx.c
diff --git a/drivers/net/nfp/Makefile b/drivers/net/nfp/Makefile
index ef7a13d..2e5ff0e 100644
--- a/drivers/net/nfp/Makefile
+++ b/drivers/net/nfp/Makefile
@@ -40,7 +40,7 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
 EXPORT_MAP := rte_pmd_nfp_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_eal -lrte_mempool
 LIBABIVER := 1
 
 #
diff --git a/drivers/net/null/Makefile b/drivers/net/null/Makefile
index 2202389..0cf4648 100644
--- a/drivers/net/null/Makefile
+++ b/drivers/net/null/Makefile
@@ -40,7 +40,7 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
 EXPORT_MAP := rte_pmd_null_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_kvargs 
 LIBABIVER := 1
 
 #
diff --git a/drivers/net/pcap/Makefile b/drivers/net/pcap/Makefile
index b41d8a2..1c118b8 100644
--- a/drivers/net/pcap/Makefile
+++ b/drivers/net/pcap/Makefile
@@ -42,7 +42,7 @@ CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lpcap
 
 EXPORT_MAP := rte_pmd_pcap_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_kvargs
 LIBABIVER := 1
 
 #
diff --git a/drivers/net/ring/Makefile b/drivers/net/ring/Makefile
index ae83505..88b7f34 100644
--- a/drivers/net/ring/Makefile
+++ b/drivers/net/ring/Makefile
@@ -40,7 +40,7 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
 EXPORT_MAP := rte_eth_ring_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_eal -lrte_kvargs -lrte_ring
 LIBABIVER := 2
 
 #
diff --git a/drivers/net/szedata2/Makefile b/drivers/net/szedata2/Makefile
index 963a8d6..bf0b44e 100644
--- a/drivers/net/szedata2/Makefile
+++ b/drivers/net/szedata2/Makefile
@@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lsze2
 
 EXPORT_MAP := rte_pmd_szedata2_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_kvargs
 LIBABIVER := 1
 
 #
diff --git a/drivers/net/virtio/Makefile b/drivers/net/virtio/Makefile
index 43835ba..7ad367d 100644
--- a/drivers/net/virtio/Makefile
+++ b/drivers/net/virtio/Makefile
@@ -40,7 +40,7 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
 EXPORT_MAP := rte_pmd_virtio_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_eal -lrte_mempool
 LIBABIVER := 1
 
 #
diff --git a/drivers/net/vmxnet3/Makefile b/drivers/net/vmxnet3/Makefile
index 4cf3b33..5fca519 100644
--- a/drivers/net/vmxnet3/Makefile
+++ b/drivers/net/vmxnet3/Makefile
@@ -67,7 +67,7 @@ endif
 VPATH += $(SRCDIR)/base
 
 EXPORT_MAP := rte_pmd_vmxnet3_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_eal -lrte_mempool
 LIBABIVER := 1
 
 #
diff --git a/drivers/net/xenvirt/Makefile b/drivers/net/xenvirt/Makefile
index 1d05b71..d75be73 100644
--- a/drivers/net/xenvirt/Makefile
+++ b/drivers/net/xenvirt/Makefile
@@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lxenstore
 
 EXPORT_MAP := rte_eth_xenvirt_version.map
-
+LDLIBS += -lrte_mbuf -lethdev -lrte_eal -lrte_mempool -lrte_cmdline
 LIBABIVER := 1
 
 #
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 24c81e7..d60f480 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_SDK_BIN)/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 $(@)")
-- 
2.13.1

