From: Ferruh Yigit Date: Fri, 10 Jun 2016 13:19:09 +0000 (+0200) Subject: mk: reduce scope of whole-archive static linking X-Git-Tag: spdx-start~6780 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=95dc3c3cf31c;p=dpdk.git mk: reduce scope of whole-archive static linking 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 --- diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 99a7047cf0..e9969fc5b6 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