From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: [PATCH v2 6/6] mk: reduce scope of whole-archive static linking Date: Fri, 10 Jun 2016 15:19:09 +0200 Message-ID: <1465564749-1405-7-git-send-email-thomas.monjalon@6wind.com> References: <1464367686-3475-1-git-send-email-ferruh.yigit@intel.com> <1465564749-1405-1-git-send-email-thomas.monjalon@6wind.com> Cc: dev@dpdk.org To: Ferruh Yigit Return-path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 37E732BD6 for ; Fri, 10 Jun 2016 15:19:24 +0200 (CEST) Received: by mail-wm0-f49.google.com with SMTP id m124so101805224wme.1 for ; Fri, 10 Jun 2016 06:19:24 -0700 (PDT) In-Reply-To: <1465564749-1405-1-git-send-email-thomas.monjalon@6wind.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Ferruh Yigit The --whole-archive argument is only required for plugins (drivers) and libraries used by these plugins. Currently it covers all libraries. Reducing the scope of this argument slightly reduce final application size when statically linked. Signed-off-by: Ferruh Yigit Signed-off-by: Thomas Monjalon --- v2: keep some basic libs in the whole-archive scope --- mk/rte.app.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 99a7047..e9969fc 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -60,8 +60,6 @@ _LDLIBS-y += -L$(RTE_SDK_BIN)/lib # Order is important: from higher level to lower level # -_LDLIBS-y += --whole-archive - ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_KNI) += -lrte_kni _LDLIBS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += -lrte_ivshmem @@ -81,6 +79,8 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl _LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS) += -lrte_jobstats _LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power +_LDLIBS-y += --whole-archive + _LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER) += -lrte_timer _LDLIBS-$(CONFIG_RTE_LIBRTE_HASH) += -lrte_hash _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost @@ -138,6 +138,8 @@ endif # CONFIG_RTE_LIBRTE_CRYPTODEV endif # !CONFIG_RTE_BUILD_SHARED_LIBS +_LDLIBS-y += --no-whole-archive + ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) # The static libraries do not know their dependencies. # So linking with static library requires explicit dependencies. @@ -155,8 +157,6 @@ endif # !CONFIG_RTE_BUILD_SHARED_LIBS _LDLIBS-y += $(EXECENV_LDLIBS) -_LDLIBS-y += --no-whole-archive - LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS) # Eliminate duplicates without sorting -- 2.7.0