From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 10056A04DD for ; Thu, 26 Nov 2020 17:37:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BF554CA1C; Thu, 26 Nov 2020 17:37:20 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 75915CA12; Thu, 26 Nov 2020 17:37:16 +0100 (CET) IronPort-SDR: XsGiRG/mE00y2zOwtNW2i4VxKRjb0oM+pME/KvE/ATewTBfx6zBWnagU5JvOiLkGfuPLvWmkl0 fvEhSlhqPL7g== X-IronPort-AV: E=McAfee;i="6000,8403,9817"; a="160077211" X-IronPort-AV: E=Sophos;i="5.78,372,1599548400"; d="scan'208";a="160077211" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Nov 2020 08:37:08 -0800 IronPort-SDR: hFwnm06euMGRM1RLC6d8Uo7K7+4zY+vv3OhIWjgVTp+FpghNAXLJ69YH8wrem7y5OSWIHuzYN+ oDbQn5rSdzyA== X-IronPort-AV: E=Sophos;i="5.78,372,1599548400"; d="scan'208";a="537362983" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.21.198]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 26 Nov 2020 08:37:06 -0800 Date: Thu, 26 Nov 2020 16:37:03 +0000 From: Bruce Richardson To: Olivier Matz Cc: dev@dpdk.org, Harry van Haaren , Keith Wiles , Luca Boccassi , stable@dpdk.org Message-ID: <20201126163703.GH1340@bricha3-MOBL.ger.corp.intel.com> References: <20201126142042.24741-1-olivier.matz@6wind.com> <20201126152846.GD1340@bricha3-MOBL.ger.corp.intel.com> <20201126163226.GZ1898@platinum> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201126163226.GZ1898@platinum> Subject: Re: [dpdk-stable] [PATCH] app: fix plugin load on static builds X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Thu, Nov 26, 2020 at 05:32:26PM +0100, Olivier Matz wrote: > Hi Bruce, > > Thanks for the feedback. > > On Thu, Nov 26, 2020 at 03:28:46PM +0000, Bruce Richardson wrote: > > On Thu, Nov 26, 2020 at 03:20:42PM +0100, Olivier Matz wrote: > > > When dpdk is compiled as static libraries, it is not possible > > > to load a plugin from an application. We get the following error: > > > > > > EAL: librte_pmd_xxxx.so: undefined symbol: per_lcore__rte_errno > > > > > > This happens because the dpdk symbols are not exported. Add them to the > > > dynamic symbol table by using '-Wl,--export-dynamic'. This option was > > > previously present when compiled with Makefiles, it was introduced in > > > commit f9a08f650211 ("eal: add support for shared object drivers") > > > > > > Fixes: 16ade738fd0d ("app/testpmd: build with meson") > > > Fixes: 89f0711f9ddf ("examples: build some samples with meson") > > > Cc: stable@dpdk.org > > > > > > Signed-off-by: Olivier Matz > > > --- > > > > > > Hi, > > > > > > Maybe the patch can be improved: I suppose that --export-dynamic > > > should only be added in case we are linking in static mode. Any > > > help about how to do that is welcome. > > > > get_option('default_library') == 'static' > > > > However, if the flag is harmless in shared linking mode, I don't think we > > need bother with this. > > ok > > > > > > > There is probably a better place to define the default ldflags for > > > all applications (to factorize between app and example). > > > > > > Also, should this flag be advertised in pkg-config? > > > > > Perhaps. However, I'm not sure how common it would be for people to static > > link their own apps with DPDK and then want to plug in extra drivers after > > the fact? Are there any possible negative impacts to making that change? > > I don't know if it is common, but this is something we do :) > > > If we weren't right before the release deadline I'd definitely suggest > > adding it to the pkg-config files. At this late stage in release, I'm more > > cautious. > > Yes, it is too late for 20.11. Maybe even for this patch without > updating pkg-config. > Well, since this is something clearly broken that is of use to you, I think we should strive to get some fix for it in. Based on the lateness of the hour, I think your patch is pretty close to the least-risky option we could take here. Therefore, despite my previous comment about not needing to limit the additional linking flag to static-builds only, I would suggest - out of an abundance of caution - that we do so, and keep the rest of your patch as-is for 20.11. Thereafter we can look at other possible approaches and simplifications in 21.02 and backport them. So, for your patch with "if get_option('default_library') ..." checks added appropriately: Acked-by: Bruce Richardson