On Tue, Jun 09, 2026 at 08:47:33AM +0100, Bruce Richardson wrote:
> On Tue, Jun 09, 2026 at 10:02:20AM +0530, Srikanth Yalavarthi wrote:
> > When linking with non-versioned libraries, absolute paths
> > of the libraries are added to libdpdk.pc. This patch replaces
> > the absolute path with correct linker flags, -l<libname>.
> > 
> 
> Do we need to check if we need a "-L" flag for some of these paths that are
> stripped?
> 
> > https://github.com/mesonbuild/meson/issues/7766
> > 
> > Signed-off-by: Srikanth Yalavarthi <[email protected]>
> > ---
> >  buildtools/pkg-config/set-static-linker-flags.py | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/buildtools/pkg-config/set-static-linker-flags.py 
> > b/buildtools/pkg-config/set-static-linker-flags.py
> > index 2745db34c29..bd217b07fc8 100644
> > --- a/buildtools/pkg-config/set-static-linker-flags.py
> > +++ b/buildtools/pkg-config/set-static-linker-flags.py
> > @@ -6,9 +6,16 @@
> >  # Should be called from meson build itself
> >  import os
> >  import sys
> > +import re
> >  
> >  
> >  def fix_ldflag(f):
> > +    if f.startswith('/'):
> > +        libfile = os.path.basename(f)
> > +        m = re.match(r'^lib(.+?)\.(a|so(?:\..*)?)$', libfile)
> > +        if m:
> > +            return '-l' + m.group(1)
> > +
> >      if not f.startswith('-lrte_'):
> >          return f
> >      return '-l:lib' + f[2:] + '.a'
> > -- 
> > 2.34.1
> > 

I don't have any massive objections to this. I'm just a little concerned
about possible side-effects, i.e. if there are occasions where we may need
or want the full paths in the pkg-config output. However, I suppose we will
never discover that unless we actually put something like this in.

In terms of the two specific libraries that are causing the problems in
your case. Is there no chance of getting whoever develops those to add
proper SONAMES to the libraries to avoid this issue completely?

/Bruce

Reply via email to