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 975245A7D for ; Thu, 29 Jan 2015 16:20:17 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 29 Jan 2015 07:15:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,486,1418112000"; d="scan'208";a="519676273" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga003.jf.intel.com with ESMTP; 29 Jan 2015 07:12:59 -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 t0TFKCgh031974 for ; Thu, 29 Jan 2015 15:20:12 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t0TFKCgd026472 for ; Thu, 29 Jan 2015 15:20:12 GMT Received: (from smonroy@localhost) by sivswdev02.ir.intel.com with id t0TFKCFX026468 for dev@dpdk.org; Thu, 29 Jan 2015 15:20:12 GMT From: Sergio Gonzalez Monroy To: dev@dpdk.org Date: Thu, 29 Jan 2015 15:20:10 +0000 Message-Id: <1422544811-26385-8-git-send-email-sergio.gonzalez.monroy@intel.com> X-Mailer: git-send-email 1.8.5.4 In-Reply-To: <1422544811-26385-1-git-send-email-sergio.gonzalez.monroy@intel.com> References: <1422544811-26385-1-git-send-email-sergio.gonzalez.monroy@intel.com> Subject: [dpdk-dev] [PATCH 7/8] mk: update LDLIBS for app building 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: Thu, 29 Jan 2015 15:20:22 -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-needed when linking against shared DPDK libs. - Link against EXECENV_LIBS always with --as-needed flag. Signed-off-by: Sergio Gonzalez Monroy --- mk/rte.app.mk | 45 ++++++++++++++------------------------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 4c70743..2c9a856 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -59,7 +59,14 @@ LDLIBS += -L$(RTE_SDK_BIN)/lib # ifeq ($(NO_AUTOLIBS),) -LDLIBS += --whole-archive +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) +LDLIBS += --as-needed +else +LDLIBS += --no-as-needed +LDLIBS += --start-group +endif + +LDLIBS += -lrte_core ifeq ($(CONFIG_RTE_LIBRTE_DISTRIBUTOR),y) LDLIBS += -lrte_distributor @@ -124,19 +131,14 @@ LDLIBS += -lpcap endif ifeq ($(CONFIG_RTE_LIBRTE_VHOST),y) +LDLIBS += -lrte_vhost LDLIBS += -lfuse 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 @@ -145,22 +147,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 @@ -180,6 +166,7 @@ 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 @@ -189,10 +176,6 @@ ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) LDLIBS += -lrte_pmd_virtio_uio endif -ifeq ($(CONFIG_RTE_LIBRTE_VHOST), y) -LDLIBS += -lrte_vhost -endif - ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) LDLIBS += -lrte_pmd_enic endif @@ -221,14 +204,14 @@ ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y) LDLIBS += -lrte_pmd_af_packet endif +LDLIBS += --no-whole-archive +LDLIBS += --end-group +LDLIBS += --as-needed + endif # plugins LDLIBS += $(EXECENV_LDLIBS) -LDLIBS += --end-group - -LDLIBS += --no-whole-archive - endif # ifeq ($(NO_AUTOLIBS),) LDLIBS += $(CPU_LDLIBS) -- 1.9.3