diff mbox

[dpdk-dev,RFC,12/13] mk: update apps build

Message ID 1421080446-19249-13-git-send-email-sergio.gonzalez.monroy@intel.com (mailing list archive)
State RFC, archived
Headers show

Commit Message

Sergio Gonzalez Monroy Jan. 12, 2015, 4:34 p.m. UTC
This patch does:
 - Update the app building command to link against librte_core.
 - Set --start-group/--end-group and --whole-archive/--no-whole-archive
 flags only when linking against static DPDK libs.
 - Set --as--need/--no-as-needed when linknig against shared DPDK libs.
 - Link against EXECENV_LIBS always with --as-needed flag.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 mk/rte.app.mk | 64 ++++++++++++++++++++++++-----------------------------------
 1 file changed, 26 insertions(+), 38 deletions(-)
diff mbox

Patch

diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index becdac5..1fc19e1 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -59,22 +59,27 @@  LDLIBS += -L$(RTE_SDK_BIN)/lib
 #
 ifeq ($(NO_AUTOLIBS),)
 
-LDLIBS += --whole-archive
-
-ifeq ($(CONFIG_RTE_LIBRTE_DISTRIBUTOR),y)
-LDLIBS += -lrte_distributor
+ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
+LDLIBS += --as-needed
+else
+LDLIBS += --no-as-needed
+LDLIBS += --start-group
 endif
 
-ifeq ($(CONFIG_RTE_LIBRTE_KNI),y)
+LDLIBS += -lrte_core
+
 ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y)
+ifeq ($(CONFIG_RTE_LIBRTE_KNI),y)
 LDLIBS += -lrte_kni
 endif
-endif
 
 ifeq ($(CONFIG_RTE_LIBRTE_IVSHMEM),y)
-ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y)
 LDLIBS += -lrte_ivshmem
 endif
+endif # CONFIG_RTE_EXEC_ENV_LINUXAPP
+
+ifeq ($(CONFIG_RTE_LIBRTE_DISTRIBUTOR),y)
+LDLIBS += -lrte_distributor
 endif
 
 ifeq ($(CONFIG_RTE_LIBRTE_PIPELINE),y)
@@ -123,16 +128,10 @@  ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y)
 LDLIBS += -lpcap
 endif
 
-LDLIBS += --start-group
-
 ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y)
 LDLIBS += -lrte_kvargs
 endif
 
-ifeq ($(CONFIG_RTE_LIBRTE_MBUF),y)
-LDLIBS += -lrte_mbuf
-endif
-
 ifeq ($(CONFIG_RTE_LIBRTE_IP_FRAG),y)
 LDLIBS += -lrte_ip_frag
 endif
@@ -141,22 +140,6 @@  ifeq ($(CONFIG_RTE_LIBRTE_ETHER),y)
 LDLIBS += -lethdev
 endif
 
-ifeq ($(CONFIG_RTE_LIBRTE_MALLOC),y)
-LDLIBS += -lrte_malloc
-endif
-
-ifeq ($(CONFIG_RTE_LIBRTE_MEMPOOL),y)
-LDLIBS += -lrte_mempool
-endif
-
-ifeq ($(CONFIG_RTE_LIBRTE_RING),y)
-LDLIBS += -lrte_ring
-endif
-
-ifeq ($(CONFIG_RTE_LIBRTE_EAL),y)
-LDLIBS += -lrte_eal
-endif
-
 ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y)
 LDLIBS += -lrte_cmdline
 endif
@@ -165,6 +148,11 @@  ifeq ($(CONFIG_RTE_LIBRTE_CFGFILE),y)
 LDLIBS += -lrte_cfgfile
 endif
 
+ifeq ($(CONFIG_RTE_LIBRTE_VHOST), y)
+LDLIBS += -lrte_vhost
+LDLIBS += -lfuse
+endif
+
 ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y)
 LDLIBS += -lrte_pmd_bond
 endif
@@ -175,7 +163,10 @@  LDLIBS += -lxenstore
 endif
 
 ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
+#
 # plugins (link only if static libraries)
+#
+LDLIBS += --whole-archive
 
 ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y)
 LDLIBS += -lrte_pmd_vmxnet3_uio
@@ -185,11 +176,6 @@  ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y)
 LDLIBS += -lrte_pmd_virtio_uio
 endif
 
-ifeq ($(CONFIG_RTE_LIBRTE_VHOST), y)
-LDLIBS += -lrte_vhost
-LDLIBS += -lfuse
-endif
-
 ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y)
 LDLIBS += -lrte_pmd_enic
 endif
@@ -218,13 +204,15 @@  ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y)
 LDLIBS += -lrte_pmd_af_packet
 endif
 
-endif # plugins
-
-LDLIBS += $(EXECENV_LDLIBS)
+LDLIBS += --no-whole-archive
 
 LDLIBS += --end-group
 
-LDLIBS += --no-whole-archive
+LDLIBS += --as-needed
+
+endif # plugins
+
+LDLIBS += $(EXECENV_LDLIBS)
 
 endif # ifeq ($(NO_AUTOLIBS),)