[dpdk-dev] [PATCH v3 6/7] build/pkg-config: improve static linking flags
Thomas Monjalon
thomas at monjalon.net
Wed Jul 1 16:45:20 CEST 2020
01/07/2020 16:36, Bruce Richardson:
> On Wed, Jul 01, 2020 at 04:33:27PM +0200, Thomas Monjalon wrote:
> > 01/07/2020 16:30, Thomas Monjalon:
> > > 30/06/2020 16:14, Bruce Richardson:
> > > > Rather than setting -Bstatic in the linker flags when doing a static link,
> > > > and then having to explicitly set -Bdynamic again afterwards, we can update
> > > > the pkg-config file to use -l:libfoo.a syntax to explicitly refer to the
> > > > static library in question. Since this syntax is not supported by meson's
> > > > pkg-config module directly, we can post-process the .pc files instead to
> > > > adjust them.
> > > >
> > > > Once done, we can simplify the examples' makefiles and the docs by removing
> > > > the explicit static flag.
> > > >
> > > > Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> > > > Acked-by: Luca Boccassi <bluca at debian.org>
> > > > Acked-by: Sunil Pai G <sunil.pai.g at intel.com>
> > > > ---
> > > > --- a/buildtools/pkg-config/meson.build
> > > > +++ b/buildtools/pkg-config/meson.build
> > > > +# the pkg-config file generated is not best tuned for static linking so
> > > > +# use a script to adjust the linker flags
> > > > +run_command(py3, 'set-static-linker-flags.py', check: true)
> > >
> > > The comment could be made more precise:
> > > # For static linking with dependencies as shared libraries,
> > > # the static libraries must be flagged explicitly.
> >
> > Even better:
> >
> > > # For static linking with dependencies as shared libraries,
> > > # the internal static libraries must be flagged explicitly.
> >
> Should "dependencies" be clarified as "external" or "non-DPDK"
> dependencies?
Yes:
# For static linking with external dependencies as shared libraries,
# the internal static libraries must be flagged explicitly.
More information about the dev
mailing list