DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Srikanth Yalavarthi <syalavarthi@marvell.com>
Cc: David Marchand <david.marchand@redhat.com>,
	Aaron Conole <aconole@redhat.com>,
	Igor Russkikh <irusskikh@marvell.com>, <dev@dpdk.org>,
	<sshankarnara@marvell.com>, <aprabhu@marvell.com>,
	<ptakkar@marvell.com>, <stable@dpdk.org>
Subject: Re: [PATCH v4 1/1] build: add libarchive to external deps
Date: Fri, 3 Nov 2023 16:50:58 +0000	[thread overview]
Message-ID: <ZUUk8olQd5rkjin4@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <20231103163853.29576-1-syalavarthi@marvell.com>

On Fri, Nov 03, 2023 at 09:38:53AM -0700, Srikanth Yalavarthi wrote:
> In order to avoid linking with Libs.private, libarchive
> is not added to ext_deps during the meson setup stage.
> 
> Since libarchive is not added to ext_deps, cross-compilation
> or native compilation with libarchive installed in non-standard
> location fails with errors related to "cannot find -larchive"
> or "archive.h: No such file or directory". In order to fix the
> build failures, user is required to define the 'c_args' and
> 'c_link_args' with '-I<includedir>' and '-L<libdir>'.
> 
> This patch adds libarchive to ext_deps and further would not
> require setting c_args and c_link_args externally.
> 
> Fixes: 40edb9c0d36b ("eal: handle compressed firmware")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>

I think this is the cleanest solution to the problem you were having.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

One minor comment below. Patch is ok without taking it on board if you
like.

> ---
> v4:
>   - Rebase over latest main
> v3:
>   - Add to libarchive ext_deps
> v2:
>   - Update ml/cnxk meson config
> v1:
>   - Initial patch
> 
>  config/meson.build          | 5 -----
>  drivers/ml/cnxk/meson.build | 1 +
>  lib/eal/meson.build         | 3 +++
>  3 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/config/meson.build b/config/meson.build
> index 0968351740..250833d0a4 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -241,11 +241,6 @@ dpdk_conf.set('RTE_BACKTRACE', cc.has_header('execinfo.h') or is_windows)
>  libarchive = dependency('libarchive', required: false, method: 'pkg-config')
>  if libarchive.found()
>      dpdk_conf.set('RTE_HAS_LIBARCHIVE', 1)
> -    # Push libarchive link dependency at the project level to support
> -    # statically linking dpdk apps. Details at:
> -    # https://inbox.dpdk.org/dev/20210605004024.660267a1@sovereign/
> -    add_project_link_arguments('-larchive', language: 'c')
> -    dpdk_extra_ldflags += '-larchive'
>  endif
>  
>  # check for libbsd
> diff --git a/drivers/ml/cnxk/meson.build b/drivers/ml/cnxk/meson.build
> index 0680a0faa5..921dc7e89b 100644
> --- a/drivers/ml/cnxk/meson.build
> +++ b/drivers/ml/cnxk/meson.build
> @@ -67,6 +67,7 @@ sources += files(
>          'mvtvm_ml_model.c',
>  )
>  
> +ext_deps += libarchive

minor nit - I don't think this is necessary. If libarchive is found, then
DPDK eal will be linked against it, and so all other drivers should simply
have that as a transitive dependency.

Same probably applies to jansson.

>  ext_deps += jansson_dep
>  ext_deps += dlpack_dep
>  ext_deps += dmlc_dep
> diff --git a/lib/eal/meson.build b/lib/eal/meson.build
> index 9942104386..e1d6c4cf17 100644
> --- a/lib/eal/meson.build
> +++ b/lib/eal/meson.build
> @@ -21,6 +21,9 @@ endif
>  if dpdk_conf.has('RTE_USE_LIBBSD')
>      ext_deps += libbsd
>  endif
> +if dpdk_conf.has('RTE_HAS_LIBARCHIVE')
> +    ext_deps += libarchive
> +endif
>  if cc.has_function('getentropy', prefix : '#include <unistd.h>')
>      cflags += '-DRTE_LIBEAL_USE_GETENTROPY'
>  endif
> -- 
> 2.42.0
> 

  reply	other threads:[~2023-11-03 16:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20 17:01 [PATCH 1/1] build: update link args and includes for libarchive Srikanth Yalavarthi
2023-10-23  9:26 ` Bruce Richardson
2023-10-23 11:40   ` [EXT] " Srikanth Yalavarthi
2023-10-23 11:53     ` Bruce Richardson
2023-10-23 12:46       ` Srikanth Yalavarthi
2023-10-23 13:00         ` Bruce Richardson
2023-10-23 13:06           ` Bruce Richardson
2023-10-23 14:01             ` Srikanth Yalavarthi
2023-10-26 12:53               ` Srikanth Yalavarthi
2023-10-29  8:10 ` [PATCH v2 1/1] build: add libarchive to external deps Srikanth Yalavarthi
2023-10-29  8:20 ` [PATCH v3 " Srikanth Yalavarthi
2023-11-03 16:38 ` [PATCH v4 " Srikanth Yalavarthi
2023-11-03 16:50   ` Bruce Richardson [this message]
2023-11-06  4:27     ` [EXT] " Srikanth Yalavarthi
2023-11-06  4:12 ` [PATCH v5 " Srikanth Yalavarthi
2023-11-06  8:53   ` Bruce Richardson
2023-11-06 15:24     ` Thomas Monjalon
2023-11-06 15:32       ` Thomas Monjalon
2023-11-06 16:03   ` David Marchand
2023-11-06 16:23     ` Bruce Richardson
2023-11-06 18:17       ` David Marchand

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=ZUUk8olQd5rkjin4@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=aconole@redhat.com \
    --cc=aprabhu@marvell.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=irusskikh@marvell.com \
    --cc=ptakkar@marvell.com \
    --cc=sshankarnara@marvell.com \
    --cc=stable@dpdk.org \
    --cc=syalavarthi@marvell.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).