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 58A2FA04DD; Thu, 26 Nov 2020 18:13:18 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B448CCA2E; Thu, 26 Nov 2020 18:13:15 +0100 (CET) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id 2E310CA12 for ; Thu, 26 Nov 2020 18:13:15 +0100 (CET) Received: by mail-wm1-f66.google.com with SMTP id 1so3106760wme.3 for ; Thu, 26 Nov 2020 09:13:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pBN1mj+WgK7tX80GyzFNgE6zC5UkArxDlLK7fBCfDSE=; b=HXeeVsxtuhxlQ/Jk3JGPhKboLbqQmBFYfel8J9yn0NU6pL98nl77ONWmzFbZjZB7NM lbMiwq8ww0qWep9MUXZhfnINzaMxaVI3Jarl7kugcUHTRukP59EurnwE3heAndw/WkL9 zKlgLLozWqJs+LzSIeYEil1h48WDY3LMYFaFmPsvLsaoGBrAQiRaoGyACCl8Cl9pYpkX dWjmIyDhp61nvy8/3dP1YE7jLLTNsNFrBo+NVwXvAbqfDdpbi+op8A3c+2uqSHTiu1qD AMxLcTt2cGzS4ZOEACPYHMzO83BIJWk1RbjYyeuDgRW5/DffjLSn14yxwWVPtHzv5jx5 y1QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=pBN1mj+WgK7tX80GyzFNgE6zC5UkArxDlLK7fBCfDSE=; b=g00UH7G27YaVz/D+RiRn8DR4SL+kJ7zWfxwo3CuVxjFOX0jZOSqGbB2tISGxyTUsjy lqihD2AuccpeucVFOzKvDln58ngF7foaAaWWhnQWb1BU37J9U5FU1tBGy12LTXLn/ypC ui22GNgudIgmVS6sizMIENMwW3hTM4J2uOueexKXa8CQ3dLgwOtlHg748fiyZMoGpPAf 4dlvU+IZgKAYtAOd47zGYPoxVDfWVzgXyKusEz6w3QV24V5nploZnTHKhQ5gmVAm16+/ C+Cx9WapWUrQkX4eSsrFr/+RFE5Syczr8Hn40bgHcCZXP546KwJ6zEWbGy+Qw5nv/JTw 9/5g== X-Gm-Message-State: AOAM531naYfGRUMHUeEmIbGC4eWk+2HSkjfvWoo3YY62/R/X3alk2D0g 70JWTS0QHoPMEaL5zs54Bcjfyg== X-Google-Smtp-Source: ABdhPJx0A4t221RnvcULck31gZALsd5j7rQroGGgBszeeDytzm+aABosc9YaybYYuIiDViSGlXU0oQ== X-Received: by 2002:a05:600c:2110:: with SMTP id u16mr4519215wml.178.1606410793718; Thu, 26 Nov 2020 09:13:13 -0800 (PST) Received: from 6wind.com (2a01cb0c0005a600345636f7e65ed1a0.ipv6.abo.wanadoo.fr. [2a01:cb0c:5:a600:3456:36f7:e65e:d1a0]) by smtp.gmail.com with ESMTPSA id g138sm9158762wme.39.2020.11.26.09.13.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 09:13:13 -0800 (PST) Date: Thu, 26 Nov 2020 18:13:12 +0100 From: Olivier Matz To: Thomas Monjalon Cc: Bruce Richardson , stable@dpdk.org, dev@dpdk.org, Harry van Haaren , Keith Wiles , Luca Boccassi Message-ID: <20201126171312.GB1898@platinum> References: <20201126142042.24741-1-olivier.matz@6wind.com> <20201126163226.GZ1898@platinum> <20201126163703.GH1340@bricha3-MOBL.ger.corp.intel.com> <2510990.SFP7MGkWmT@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2510990.SFP7MGkWmT@thomas> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] app: fix plugin load on static builds 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 Thu, Nov 26, 2020 at 06:07:32PM +0100, Thomas Monjalon wrote: > 26/11/2020 17:37, Bruce Richardson: > > 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 > > The most critical issue is for externally built applications > statically linked using external plugins. > This patch fixes only internal apps built with meson. > > I am for keeping the issue as-is for 20.11.0, > because it is really too late to change a compilation option. > We have already been bitten by compilers not supporting an option > or being buggy in specific contexts. I prefer not taking this risk > for a fix which helps nobody really. Correct. On my side, it is not an issue if this patch does not go in 20.11.