From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id E014411D9 for ; Tue, 31 Jan 2017 15:36:20 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 31 Jan 2017 06:36:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,315,1477983600"; d="scan'208";a="37783706" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.38]) ([10.237.220.38]) by orsmga002.jf.intel.com with ESMTP; 31 Jan 2017 06:36:18 -0800 To: Thomas Monjalon References: <20170131121427.31279-1-ferruh.yigit@intel.com> <20170131121427.31279-2-ferruh.yigit@intel.com> <2710569.WpYSWQ2PKI@xps13> Cc: dev@dpdk.org From: Ferruh Yigit Message-ID: <22948d37-7448-c07a-33ca-87b2007847f9@intel.com> Date: Tue, 31 Jan 2017 14:36:17 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <2710569.WpYSWQ2PKI@xps13> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 2/2] mk: move PMD libraries to applications X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 14:36:21 -0000 On 1/31/2017 2:16 PM, Thomas Monjalon wrote: > 2017-01-31 12:14, Ferruh Yigit: >> Same PMDs provide device specific APIs. Bond and xenvirt are existing >> samples for this. > > s/Same/Some/ > >> And since these are PMD libraries, there are two options on how to link >> them. >> >> 1- They can be fully included to all applications, using common >> rte.app.mk file by default. >> >> 2- They can be explicitly linked to applications that use device >> specific API. >> >> Currently option one is in use, this patch switches to the option two. >> >> Moves library linking to the application of Makefile that uses device >> specific API. >> >> This prevent including these libraries into final applications that >> don't use these device specific APIs. > > That's an interesting point of view. > What about the other libraries automatically linked in rte.app.mk? > Could we make each application decide which library they want to be > linked with? Not need to. For static library compilation, if the library in not within --whole-archive flag, linker will get only used objects to final binary. No harm on providing all libraries for that case. For shared library compilation, PMDs are not linked against binary. And other libraries can be added without problem because of "--as-needed" flag, again linker will take care of unused libs. But for example bonding pmd, for shared compilation, linked against all applications, it is linked even against helloworld sample application: $ ldd examples/helloworld/build/helloworld | grep bond librte_pmd_bond.so.1.1 => /root/dpdk/build/lib/librte_pmd_bond.so.1.1 (0x00007fa56da9a000) I recognized that the comment in commit log is not exactly true, this is not related to static compilation and including pmd into final binary, that will always happen for a pmd in static build. This is about making PMD a dependency to all applications or to the applications that use it, for shared library compilation.