From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id B736D5AD4 for ; Mon, 12 Jan 2015 17:34:14 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 12 Jan 2015 08:30:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,744,1413270000"; d="scan'208";a="668520276" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 12 Jan 2015 08:34:13 -0800 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t0CGYD2o022042 for ; Mon, 12 Jan 2015 16:34:13 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t0CGYCL8019378 for ; Mon, 12 Jan 2015 16:34:12 GMT Received: (from smonroy@localhost) by sivswdev02.ir.intel.com with id t0CGYCDs019374 for dev@dpdk.org; Mon, 12 Jan 2015 16:34:12 GMT From: Sergio Gonzalez Monroy To: dev@dpdk.org Date: Mon, 12 Jan 2015 16:34:05 +0000 Message-Id: <1421080446-19249-13-git-send-email-sergio.gonzalez.monroy@intel.com> X-Mailer: git-send-email 1.8.5.4 In-Reply-To: <1421080446-19249-1-git-send-email-sergio.gonzalez.monroy@intel.com> References: <1421080446-19249-1-git-send-email-sergio.gonzalez.monroy@intel.com> Subject: [dpdk-dev] [PATCH RFC 12/13] mk: update apps build X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2015 16:34:15 -0000 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 --- 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