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 96757A0A04; Fri, 15 Jan 2021 19:41:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 25FAF140D57; Fri, 15 Jan 2021 19:41:23 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 56DCC140D19 for ; Fri, 15 Jan 2021 19:41:21 +0100 (CET) IronPort-SDR: D8mBYMODmXFTGTvcH8nZBoOMnWKPZj3fifowzEnxCv8dp5iTXP6Jje0zydUNQ9ENsr+ulsjZ2f Jx8Cxp3yWOMQ== X-IronPort-AV: E=McAfee;i="6000,8403,9865"; a="197260483" X-IronPort-AV: E=Sophos;i="5.79,350,1602572400"; d="scan'208";a="197260483" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2021 10:41:04 -0800 IronPort-SDR: O49hp6xzzsolwyRI3t5ETVkYvG84NYYi+bPfu/5829SghVxNS9xJgQNL0E2y7VmPPKckpe9OF2 RhXZf0coID0w== X-IronPort-AV: E=Sophos;i="5.79,350,1602572400"; d="scan'208";a="354399512" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.221.206]) ([10.213.221.206]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2021 10:41:02 -0800 To: Bruce Richardson , Hemant Agrawal , Akhil Goyal Cc: "dev@dpdk.org" , David Marchand References: <20201221140402.GB1753@bricha3-MOBL.ger.corp.intel.com> From: Ferruh Yigit Message-ID: Date: Fri, 15 Jan 2021 18:40:56 +0000 MIME-Version: 1.0 In-Reply-To: <20201221140402.GB1753@bricha3-MOBL.ger.corp.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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 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 And build fails: /usr/bin/ld: /usr/lib64/libz.so: error adding symbols: file in wrong format If I install the 32 bit version of the zlib, everything works as expected: $ PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig/ pkg-config --path zlib /usr/lib/pkgconfig//zlib.pc As far as I can see there is a meson 'pkg_config_libdir' property, putting it to the config/arm/arm64_* can solve the issue for arm, @Hemant can you please try it? Some more details on: github.com/mesonbuild/meson/blob/master/docs/markdown/Cross-compilation.md But not sure how to solve issue for 32bit build, any idea?