From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH 2/2] mk: reduce scope of whole-archive to pmd libraries Date: Fri, 10 Jun 2016 12:18:29 +0200 Message-ID: <4031296.h8oICZ3R2f@xps13> References: <574872B3.6040702@intel.com> <4324849.ehO8V5db18@xps13> <575A8EF4.3080002@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Panu Matilainen , Christian Ehrhardt , olivier.matz@6wind.com To: Ferruh Yigit Return-path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id 7872E2BA6 for ; Fri, 10 Jun 2016 12:18:31 +0200 (CEST) Received: by mail-wm0-f53.google.com with SMTP id v199so142352905wmv.0 for ; Fri, 10 Jun 2016 03:18:31 -0700 (PDT) In-Reply-To: <575A8EF4.3080002@intel.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" 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'