DPDK patches and discussions
 help / color / mirror / Atom feed
From: Srikanth Yalavarthi <syalavarthi@marvell.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: "dmitry.kozliuk@gmail.com" <dmitry.kozliuk@gmail.com>,
	Aaron Conole <aconole@redhat.com>,
	Igor Russkikh <irusskikh@marvell.com>,
	David Marchand <david.marchand@redhat.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	Shivah Shankar Shankar Narayan Rao <sshankarnara@marvell.com>,
	Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
	"stable@dpdk.org" <stable@dpdk.org>,
	Srikanth Yalavarthi <syalavarthi@marvell.com>
Subject: RE: [EXT] Re: [PATCH 1/1] build: update link args and includes for libarchive
Date: Thu, 26 Oct 2023 12:53:10 +0000	[thread overview]
Message-ID: <DS0PR18MB5502EAEE4635D2AD3267684BAEDDA@DS0PR18MB5502.namprd18.prod.outlook.com> (raw)
In-Reply-To: <DS0PR18MB55024CD83C78922FA34AF014AED8A@DS0PR18MB5502.namprd18.prod.outlook.com>

> -----Original Message-----
> From: Srikanth Yalavarthi <syalavarthi@marvell.com>
> Sent: 23 October 2023 19:32
> To: Bruce Richardson <bruce.richardson@intel.com>
> Cc: dmitry.kozliuk@gmail.com; Aaron Conole <aconole@redhat.com>; Igor
> Russkikh <irusskikh@marvell.com>; David Marchand
> <david.marchand@redhat.com>; dev@dpdk.org; Shivah Shankar Shankar
> Narayan Rao <sshankarnara@marvell.com>; Jerin Jacob Kollanukkaran
> <jerinj@marvell.com>; stable@dpdk.org; Srikanth Yalavarthi
> <syalavarthi@marvell.com>; Srikanth Yalavarthi <syalavarthi@marvell.com>
> Subject: RE: [EXT] Re: [PATCH 1/1] build: update link args and includes for
> libarchive
> 
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: 23 October 2023 18:36
> > To: Srikanth Yalavarthi <syalavarthi@marvell.com>
> > Cc: dmitry.kozliuk@gmail.com; Aaron Conole <aconole@redhat.com>; Igor
> > Russkikh <irusskikh@marvell.com>; David Marchand
> > <david.marchand@redhat.com>; dev@dpdk.org; Shivah Shankar Shankar
> > Narayan Rao <sshankarnara@marvell.com>; Jerin Jacob Kollanukkaran
> > <jerinj@marvell.com>; stable@dpdk.org
> > Subject: Re: [EXT] Re: [PATCH 1/1] build: update link args and
> > includes for libarchive
> >
> > On Mon, Oct 23, 2023 at 02:00:33PM +0100, Bruce Richardson wrote:
> > > On Mon, Oct 23, 2023 at 12:46:59PM +0000, Srikanth Yalavarthi wrote:
> > > > > -----Original Message-----
> > > > > From: Bruce Richardson <bruce.richardson@intel.com>
> > > > > Sent: 23 October 2023 17:24
> > > > > To: Srikanth Yalavarthi <syalavarthi@marvell.com>
> > > > > Cc: Aaron Conole <aconole@redhat.com>; Igor Russkikh
> > > > > <irusskikh@marvell.com>; David Marchand
> > > > > <david.marchand@redhat.com>; dev@dpdk.org; Shivah Shankar
> > Shankar
> > > > > Narayan Rao <sshankarnara@marvell.com>; Jerin Jacob
> > > > > Kollanukkaran <jerinj@marvell.com>; stable@dpdk.org
> > > > > Subject: Re: [EXT] Re: [PATCH 1/1] build: update link args and
> > > > > includes for libarchive
> > > > >
> > > > > On Mon, Oct 23, 2023 at 11:40:14AM +0000, Srikanth Yalavarthi wrote:
> > > > > > > -----Original Message-----
> > > > > > > From: Bruce Richardson <bruce.richardson@intel.com>
> > > > > > > Sent: 23 October 2023 14:56
> > > > > > > To: Srikanth Yalavarthi <syalavarthi@marvell.com>
> > > > > > > Cc: Aaron Conole <aconole@redhat.com>; Igor Russkikh
> > > > > > > <irusskikh@marvell.com>; David Marchand
> > > > > <david.marchand@redhat.com>;
> > > > > > > dev@dpdk.org; Shivah Shankar Shankar Narayan Rao
> > > > > > > <sshankarnara@marvell.com>; Jerin Jacob Kollanukkaran
> > > > > > > <jerinj@marvell.com>; stable@dpdk.org
> > > > > > > Subject: [EXT] Re: [PATCH 1/1] build: update link args and
> > > > > > > includes for libarchive
> > > > > > >
> > > > > > > External Email
> > > > > > >
> > > > > > > ------------------------------------------------------------
> > > > > > > --
> > > > > > > ------
> > > > > > > -- On Fri, Oct 20, 2023 at 10:01:35AM -0700, Srikanth
> > > > > > > Yalavarthi
> > > > > > > wrote:
> > > > > > > > In order to avoid linking with all libraries listed as
> > > > > > > > Libs.private in libarchive.pc, libarchive is not added to
> > > > > > > > ext_deps during
> > > > > meson setup.
> > > > > > > >
> > > > > > > > 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 updates meson build files to add libarchive's
> > > > > > > > includedir and libdir to compiler flags and 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>
> > > > > > > > ---
> > > > > > >
> > > > > > > Checking back through the mail archives I'm still a little
> > > > > > > unclear as to what breaks when we try using libarchive as
> > > > > > > any other package with a pkg-config file? I would have
> > > > > > > thought the best solution was just to add libarchive as an
> > > > > > > external dependency, found using pkg-config, to EAL. When we
> > > > > > > add it as a dependency, rather than using c/ldflags, we
> > > > > > > should get all this
> > path fixup for free?
> > > > > > > Can you clarify what breaks when we add libarchive as a
> > > > > > > libeal dependency only?
> > > > > >
> > > > > > Below is my observation.
> > > > > >
> > > > > > In current implementation, we are looking for libarchive's
> > > > > > availability
> > > > > through pkg-config.
> > > > > > When found, we are setting RTE_HAS_LIBARCHIVE=1 and adding '-
> > larchive'
> > > > > to ldflags.
> > > > > >
> > > > > > Since, we are not adding libarchive to ext_deps (to avoid
> > > > > > linking with deps.private), the
> > > > >
> > > > > This is the bit I'm a bit stuck on. What is the issues with
> > > > > adding libarchive to ext_deps? For other libs, when doing static
> > > > > builds we have to link with deps.private and it's the correct
> > > > > behaviour AFAIK. Not doing so would surely lead to problematic
> builds, no?
> > > >
> > > > I agree on adding to ext_deps as it's the correct behaviour.
> > > >
> > > > However, there was a discussion in mail archives regarding this.
> > > > https://urldefense.proofpoint.com/v2/url?u=https-
> > 3A__inbox.dpdk.org_
> > > > dev_20210605004024.660267a1-
> > 40sovereign_&d=DwIBAg&c=nKjWec2b6R0mOyPa
> > > > z7xtfQ&r=SNPqUkGl0n_Ms1iJa_6wD6LBwX8efL_NOyXvAX-
> > iCMI&m=HAX8pzasBDOgY
> > > >
> 4zxEIMFHaTzH02VdRpw5xfHxjYz1CorbIA3_Gw9SPMpIPssi23l&s=wKtxZ-
> > fddu7b0b
> > > > ADmwT_nOeJ_UjbuFNea3pcTuPKAGQ&e=
> > > >
> > > > Adding Dmitry Kozlyuk for comments.
> > > >
> > > Testing it out myself, the sample applications don't build
> > > statically due to missing dependencies. The libarchive-dev package
> > > on Ubuntu, doesn't seem to install all dependent packages for static
> builds.
> > > I had to manually install liblz4-dev and libacl1-dev packages, and
> > > then test-meson-builds ran successfully.
> > >
> > > Personally, it looks to me like a packaging issue, in that I would
> > > expect the -dev package to install all required dependent dev
> > > packages. I also think using the pkgconfig as a regular dependency
> > > is the way we should look to go, and if necessary, document the list
> > > of extra dependencies needed for libarchive in our docs.
> > >
> > For reference, here is the diff I tested with on Ubuntu 23.04:
> >
> > diff --git a/config/meson.build b/config/meson.build index
> > d56b0f9bce..4ff101767e 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -236,11 +236,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://urldefense.proofpoint.com/v2/url?u=https-
> > 3A__inbox.dpdk.org_dev_20210605004024.660267a1-
> >
> 40sovereign_&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=SNPqUkGl0n_M
> > s1iJa_6wD6LBwX8efL_NOyXvAX-
> >
> iCMI&m=HAX8pzasBDOgY4zxEIMFHaTzH02VdRpw5xfHxjYz1CorbIA3_Gw9SP
> > MpIPssi23l&s=wKtxZ-fddu7b0bADmwT_nOeJ_UjbuFNea3pcTuPKAGQ&e=
> > -    add_project_link_arguments('-larchive', language: 'c')
> > -    dpdk_extra_ldflags += '-larchive'
> >  endif
> >
> >  # check for libbsd
> > 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
> 
> I have tried this approach earlier and it work as expected. But, based on the
> discussion in mail archives, I have pushed an alternate one.

Will resubmit the patch with adding libarchive to ext_deps.

  reply	other threads:[~2023-10-26 12:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20 17:01 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 [this message]
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
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=DS0PR18MB5502EAEE4635D2AD3267684BAEDDA@DS0PR18MB5502.namprd18.prod.outlook.com \
    --to=syalavarthi@marvell.com \
    --cc=aconole@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=irusskikh@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=sshankarnara@marvell.com \
    --cc=stable@dpdk.org \
    /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).