From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1AED8A0A03; Mon, 18 Jan 2021 14:29:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 06441140EA1; Mon, 18 Jan 2021 14:29:35 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 3BF82140E9A for ; Mon, 18 Jan 2021 14:29:33 +0100 (CET) IronPort-SDR: CoEt/B30nkLa+3VtVQNaTEJO+W8159pc3BVwIDPnog3Y+GgAlk+c0N+IzMaDQWOF3N06kWToj8 lJlC+F8VdDSA== X-IronPort-AV: E=McAfee;i="6000,8403,9867"; a="175298439" X-IronPort-AV: E=Sophos;i="5.79,356,1602572400"; d="scan'208";a="175298439" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2021 05:29:31 -0800 IronPort-SDR: y6VjZheFMaO2hc+5vfGfnknpxyu94njowCEKa+W1avA/ceT7b9tTj3aYOIJAxR0gyyzemIjJ/I eYS85kIIGZQg== X-IronPort-AV: E=Sophos;i="5.79,356,1602572400"; d="scan'208";a="383572948" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.8.248]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 18 Jan 2021 05:29:30 -0800 Date: Mon, 18 Jan 2021 13:29:26 +0000 From: Bruce Richardson To: Ferruh Yigit Cc: Hemant Agrawal , Akhil Goyal , "dev@dpdk.org" , David Marchand Message-ID: <20210118132926.GD749@bricha3-MOBL.ger.corp.intel.com> References: <20201221140402.GB1753@bricha3-MOBL.ger.corp.intel.com> <20210118105113.GA749@bricha3-MOBL.ger.corp.intel.com> <17596e93-78a9-c38e-261c-28949a0caa9b@intel.com> <45a28b53-25b1-ef06-4c05-56b23dca3b76@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <45a28b53-25b1-ef06-4c05-56b23dca3b76@intel.com> Subject: Re: [dpdk-dev] meson: wrong dependency in cross compilation on ARM X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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, Jan 18, 2021 at 12:16:04PM +0000, Ferruh Yigit wrote: > On 1/18/2021 12:05 PM, Ferruh Yigit wrote: > > On 1/18/2021 11:58 AM, Ferruh Yigit wrote: > > > On 1/18/2021 10:51 AM, Bruce Richardson wrote: > > > > On Fri, Jan 15, 2021 at 06:40:56PM +0000, Ferruh Yigit wrote: > > > > > On 12/21/2020 2:04 PM, Bruce Richardson wrote: > > > > > > On Mon, Dec 21, 2020 at 12:19:17PM +0000, Hemant Agrawal wrote: > > > > > > > Hi, > > > > > > >                   I am trying to cross compile DPDK > > > > > > > for arm64 on a ubuntu machine, which has a zlib > > > > > > > pre-installed for native env. > > > > > > > > > > > > > > I am encountering following build error in net_bnx2x > > > > > > > as it has dependency on zlib.  It is trying to link > > > > > > > with x86 arch based zlib. > > > > > > > > > > > > > > Cross compiling zlib and setting the PKG_CONFIG_PATH > > > > > > > solve the issue. But, Is their an easy way to > > > > > > > disable these dependencies? > > > > > > > > > > > > > Can you try with setting PKG_CONFIG_LIBDIR rather than PKG_CONFIG_PATH? > > > > > > PKG_CONFIG_PATH simply extends the search locations, which means that > > > > > > host-paths will still be searched, while PKG_CONFIG_LIBDIR replaces the > > > > > > default path, eliminating the host-based search paths. > > > > > > > > > > > > > > > > The 'PKG_CONFIG_LIBDIR' seems not taken into account by meson, Akhil > > > > > reported a 32bit build error when zlib is missing, I can reproduce the same. > > > > > > > > > > I have only 64bit version of the library: > > > > > > > > > > $ pkg-config --path zlib > > > > > /usr/lib64/pkgconfig/zlib.pc > > > > > > > > > > $ PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig/ pkg-config --path zlib > > > > > > > > > > $ echo $? > > > > > 1 > > > > > > > > > > When I run the meson as following: > > > > > "PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig/ meson --werror -Dc_args=-m32 > > > > > -Dc_link_args=-m32 -Dexamples=all build32" > > > > > > > > > > It still detects the zlib: > > > > > Run-time dependency zlib found: YES 1.2.11 > > > > > > > > > > > > > I've just tried this on my system and it works as expected: the 32-bit lib > > > > is not found and a build succeeds. Omitting the PKG_CONFIG_LIBDIR and it is > > > > found, but linking fails due to "file in wrong format" errors, again as > > > > expected. > > > > > > > > In your case, I suspect it might be meson falling back to cmake in the > > > > detection logic. If you have cmake installed on your system, can you > > > > perhaps temporarily remove it, and retry the 32-bit build? If that is the > > > > cause, we can modify the dependency call to add "method: 'pkg-config'" to > > > > it, to force pkg-config searches only. > > > > > > > > > > Yes I have cmake, I will try without it. > > > > > > Meanwhile I have Fedora, and it seems it is using different version > > > of the pkg-config (pkgconf), not sure if this can be a problem. > > > > > > > I confirm removing the 'cmake' solved the issue, now I am getting: > > "Run-time dependency zlib found: NO (tried pkgconfig and cmake)" > > > > And zlib dependent modules not enabled, so build runs successfully. > > Following is fixing the problem [1], but isn't this a generic problem when > 64bit version of a library installed but 32bit version of it is missing and > 'cmake' exists? > > Should all library discovery reduced to the 'pkg-config' only? > Yes, I'm in the process of doing up a patch for this.