DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Bruce Richardson <bruce.richardson@intel.com>,
	Hemant Agrawal <hemant.agrawal@nxp.com>,
	Akhil Goyal <akhil.goyal@nxp.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	David Marchand <david.marchand@redhat.com>
Subject: Re: [dpdk-dev] meson: wrong dependency in cross compilation on ARM
Date: Fri, 15 Jan 2021 18:40:56 +0000
Message-ID: <c4100eb3-b3d4-8886-4752-efff5e8e7aaf@intel.com> (raw)
In-Reply-To: <20201221140402.GB1753@bricha3-MOBL.ger.corp.intel.com>

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
<no output>
$ 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?

  parent reply	other threads:[~2021-01-15 18:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-21 12:19 Hemant Agrawal
2020-12-21 14:04 ` Bruce Richardson
2020-12-21 14:28   ` Hemant Agrawal
2020-12-21 14:47     ` Bruce Richardson
2021-01-22 10:20     ` Juraj Linkeš
2021-01-15 18:40   ` Ferruh Yigit [this message]
2021-01-18 10:51     ` Bruce Richardson
2021-01-18 11:58       ` Ferruh Yigit
2021-01-18 12:05         ` Ferruh Yigit
2021-01-18 12:16           ` Ferruh Yigit
2021-01-18 13:29             ` Bruce Richardson
2021-01-22 12:47             ` Hemant Agrawal
2021-01-18 13:28         ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c4100eb3-b3d4-8886-4752-efff5e8e7aaf@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git