From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id DE57A2BAC for ; Fri, 10 Jun 2016 15:35:28 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 10 Jun 2016 06:35:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,449,1459839600"; d="scan'208";a="716996338" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.221.96]) ([10.237.221.96]) by FMSMGA003.fm.intel.com with ESMTP; 10 Jun 2016 06:35:26 -0700 To: Thomas Monjalon References: <574872B3.6040702@intel.com> <4031296.h8oICZ3R2f@xps13> <575A9F3B.50802@intel.com> <4754667.tJUpOoJvL0@xps13> Cc: dev@dpdk.org, Panu Matilainen , Christian Ehrhardt , olivier.matz@6wind.com From: Ferruh Yigit Message-ID: <575AC21D.10405@intel.com> Date: Fri, 10 Jun 2016 14:35:25 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <4754667.tJUpOoJvL0@xps13> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 2/2] mk: reduce scope of whole-archive to pmd libraries 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: Fri, 10 Jun 2016 13:35:29 -0000 On 6/10/2016 1:21 PM, Thomas Monjalon wrote: > 2016-06-10 12:06, Ferruh Yigit: >> On 6/10/2016 11:18 AM, Thomas Monjalon wrote: >>> 2016-06-10 10:57, Ferruh Yigit: >>>> On 6/10/2016 10:03 AM, Thomas Monjalon wrote: >>>>> 2016-05-27 17:48, Ferruh Yigit: >>>>>> --whole-archive argument only required for pmd libraries, and currently >>>>>> it covers more libraries. Reducing scope of the argument to pmd >>>>>> libraries slightly reduce final application size. >>>>> >>>>> In my understanding, --whole-archive is required for static libraries used >>>>> by plugins: >>>>> http://dpdk.org/commit/20afd76a >>>> Right, required for static libraries. But more than used by plugins, >>>> required for plugin to work. >>>> >>>>> If we want to restrict it, I would say it must be around EAL, ring, >>>>> mbuf, mempool, ethdev, cryptodev, etc. >>>>> >>>> >>>> We should restrict to plugins. What happens is, since there is no direct >>>> call to PMDs from application, PMD code is not included into final >>>> application. To force PMDs to be included into final binary, >>>> --whole-archive is required. >>>> >>>> But --whole-archive is not required for other libraries, and just cause >>>> unnecessary increase in binary size. >>> >>> Yes it is necessary for other libraries, otherwise some symbols needed by >>> plugins won't be available. >>> Example: >>> In function `rte_pmd_af_packet_devuninit': >>> rte_eth_af_packet.c:(.text+0x8bf): undefined reference to `rte_eth_dev_allocated' >>> rte_eth_af_packet.c:(.text+0x930): undefined reference to `rte_eth_dev_release_port' >>> >> If there is a direct call to that API, linker should include required >> object file into final binary, --whole-archive shouldn't be required for >> this. >> >> What is special for PMD's is there are not directly called, but >> initialized using constructors. >> >> How are you getting above compilation error? > > The error was generated with your patch on top of others I'm going to send. > I suggest to continue the discussion/review based on the v2 coming soon. > I have quickly checked v2, you are getting this compiler error because --start-group/--end-group removed, so pmd not able to resolve the references. And you are working around this by adding all object of library unconditionally (--whole-archive). I will comment more of v2 patch. Thanks, ferruh