From: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH RFC 12/13] mk: update apps build
Date: Mon, 12 Jan 2015 16:34:05 +0000 [thread overview]
Message-ID: <1421080446-19249-13-git-send-email-sergio.gonzalez.monroy@intel.com> (raw)
In-Reply-To: <1421080446-19249-1-git-send-email-sergio.gonzalez.monroy@intel.com>
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 --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),)
--
1.9.3
next prev parent reply other threads:[~2015-01-12 16:34 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-12 16:33 [dpdk-dev] [PATCH RFC 00/13] Update build system Sergio Gonzalez Monroy
2015-01-12 16:33 ` [dpdk-dev] [PATCH RFC 01/13] mk: Remove combined library and related options Sergio Gonzalez Monroy
2015-01-12 16:33 ` [dpdk-dev] [PATCH RFC 02/13] lib/core: create new core dir and makefiles Sergio Gonzalez Monroy
2015-01-12 16:33 ` [dpdk-dev] [PATCH RFC 03/13] core: move librte_eal to core subdir Sergio Gonzalez Monroy
2015-01-12 16:33 ` [dpdk-dev] [PATCH RFC 04/13] core: move librte_malloc " Sergio Gonzalez Monroy
2015-01-12 16:33 ` [dpdk-dev] [PATCH RFC 05/13] core: move librte_mempool " Sergio Gonzalez Monroy
2015-01-12 16:33 ` [dpdk-dev] [PATCH RFC 06/13] core: move librte_mbuf " Sergio Gonzalez Monroy
2015-01-12 16:34 ` [dpdk-dev] [PATCH RFC 07/13] core: move librte_ring " Sergio Gonzalez Monroy
2015-01-12 16:34 ` [dpdk-dev] [PATCH RFC 08/13] Update path of core libraries Sergio Gonzalez Monroy
2015-01-12 16:34 ` [dpdk-dev] [PATCH RFC 09/13] mk: new corelib makefile Sergio Gonzalez Monroy
2015-01-12 16:34 ` [dpdk-dev] [PATCH RFC 10/13] lib: Set LDLIBS for each library Sergio Gonzalez Monroy
2015-01-12 16:34 ` [dpdk-dev] [PATCH RFC 11/13] mk: Use LDLIBS when linking shared libraries Sergio Gonzalez Monroy
2015-01-12 16:34 ` Sergio Gonzalez Monroy [this message]
2015-01-12 16:34 ` [dpdk-dev] [PATCH RFC 13/13] mk: add -lpthread to linuxapp EXECENV_LDLIBS Sergio Gonzalez Monroy
2015-01-12 16:51 ` [dpdk-dev] [PATCH RFC 00/13] Update build system Thomas Monjalon
2015-01-12 17:21 ` Gonzalez Monroy, Sergio
2015-01-12 18:16 ` Neil Horman
2015-01-22 10:03 ` Gonzalez Monroy, Sergio
2015-01-22 10:38 ` Thomas Monjalon
2015-01-22 11:01 ` Gonzalez Monroy, Sergio
2015-01-13 12:26 ` Neil Horman
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=1421080446-19249-13-git-send-email-sergio.gonzalez.monroy@intel.com \
--to=sergio.gonzalez.monroy@intel.com \
--cc=dev@dpdk.org \
/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 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).