From patchwork Fri Jun 10 13:19:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 13438 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 8BE132C12; Fri, 10 Jun 2016 15:19:26 +0200 (CEST) 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NakhbtPTsckrxR3Aho5aEl+7EvorSeJGrcdWTkx7uZ0=; b=aq/rEkSpum40hEu7lFbGq+FygoM2q/5Xim2ahNXK4y4yyP/gs8cjz7Kk/x5qo6hfGj SRA7GUXpC+8PPSmgy7ev6ttq0Wz09PLLbIZnBLWBhnNVgFwLT6N14qi0vlN7ceR6DLqP MozYvyNGsTdMOiwwWny9WcU7DDiJBAXuNm+PP+rGbFUZqNt/ouNMjZqWm29SVNKIykUB 3Xk4qlTMIAsFB6+ySedyjV7+cYHQrEiIWG/He8L4K8ZtgWvDWlDwRAyT0H8NTMjMfNR6 SBCgqJKvf2LCBRqL4DA2/sCuqj60G6cZeKlawKQNGIGC9yCz5X8UKoFu2wKQzqfYTxES BZ1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NakhbtPTsckrxR3Aho5aEl+7EvorSeJGrcdWTkx7uZ0=; b=RKRh8pOLBGGvsZyW+At19Oe0VgoRsSKLgIx3x5wUptguHcpD0UbpRnL28Km183oyLt PwDrZrUJ4FRNWKHSDy9JErI9EXtOh13OiyYSAXkJ2rVUNvB6Fa1o75WYk5Y8Q7/md92n 6Vqhj1gGa/nSuR1Q47/bBY6q+UQ7IsQIaU+p2FSbGz5Si+lpt8eJ5Ym6WkZgk28ynBDz 1zl2mFsw9LcgONtMHVzuGDPfnuhzEYDGCZ8eDHWlghYgPQddqodlFjT/hMmuG/Cd6W3M muRPgjmOB2d3wKieCO0430xkTfgAVQ6INZtVlQbqXGixHbqoBpzjli+HMiy0Oka3bTno xMHA== X-Gm-Message-State: ALyK8tJiASpxShOy1ovEEQI8PPY3DXbpLJQEA+C0H8hHYyNUnf1fez2eOCGaPuqdjODMZ7zq X-Received: by 10.194.230.35 with SMTP id sv3mr2194165wjc.164.1465564763918; Fri, 10 Jun 2016 06:19:23 -0700 (PDT) Received: from XPS13.localdomain (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id o4sm12302758wjx.45.2016.06.10.06.19.23 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Jun 2016 06:19:23 -0700 (PDT) From: Thomas Monjalon To: Ferruh Yigit Cc: dev@dpdk.org Date: Fri, 10 Jun 2016 15:19:09 +0200 Message-Id: <1465564749-1405-7-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1465564749-1405-1-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> Subject: [dpdk-dev] [PATCH v2 6/6] mk: reduce scope of whole-archive static linking 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: , 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