From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 28AF5A045E for ; Tue, 28 May 2019 10:06:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A4FA19E4; Tue, 28 May 2019 10:06:33 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 003771D7 for ; Tue, 28 May 2019 10:06:31 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 01:06:30 -0700 X-ExtLoop1: 1 Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.64]) by fmsmga008.fm.intel.com with SMTP; 28 May 2019 01:06:28 -0700 Received: by (sSMTP sendmail emulation); Tue, 28 May 2019 09:06:27 +0100 Date: Tue, 28 May 2019 09:06:27 +0100 From: Bruce Richardson To: Aaron Conole Cc: David Marchand , "Ananyev, Konstantin" , dev Message-ID: <20190528080626.GA435@bricha3-MOBL.ger.corp.intel.com> References: <20190410134517.63896-1-bruce.richardson@intel.com> <20190527154121.GA429@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Subject: Re: [dpdk-dev] [PATCH 0/2] remove use of weak functions from libraries 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, May 27, 2019 at 04:57:15PM -0400, Aaron Conole wrote: > Bruce Richardson writes: > > > On Mon, May 27, 2019 at 04:13:53PM +0200, David Marchand wrote: > >> Hello, > >> On Wed, Apr 10, 2019 at 3:45 PM Bruce Richardson > >> <[1]bruce.richardson@intel.com> wrote: > >> > >> Weak functions don't work well with static library builds as the > >> linker > >> always picks the first version of a function irrespective of whether > >> it is > >> weak or not. The solution to this is to use the "whole-archive" flag > >> when > >> linking, but this has the nasty side-effect that it causes the > >> resulting > >> binary to be larger than it needs to be. > >> A further problem with this approach of using "whole-archive" is > >> that one > >> either needs to link all libraries with this flag or track what > >> libraries > >> need it or not - the latter being especially a problem for apps not > >> using > >> the DPDK build system itself (i.e. most apps not shipped with DPDK > >> itself). > >> For meson builds this information needs to make its way all the way > >> through > >> to the pkgconfig file generated - not a trivial undertaking. > >> Thankfully, though, the use of weak functions is limited to use for > >> multiple functions within a single library, meaning that when the > >> lib is > >> being built, the build system itself can know whether the "weak" > >> function > >> is needed or not. This allows us to change the weak function to a > >> conditionally compiled regular function used in fallback case. This > >> makes > >> the need for "whole-archive" flag, and any special linking measures > >> for the > >> library, go away. > >> [This set does not touch the drivers, only the libraries, since > >> there are > >> other special linker flags needed for drivers in general, making the > >> problem less severe for driver .a files.] > >> > >> Was there something preventing this patchset from getting merged ? > >> -- > >> David Marchand > >> > > I believe Aaron Conole had some changes in the same area and was looking to > > roll these changes into a bigger patchset of his. Aaron, can you please > > confirm? > > Yes - Sorry the patches are in my queue. Maybe it just makes sense to > merge these though? > Funnily enough, I've no objections to that :-)