* [PATCH 1/1] buildtools: remove absolute paths from pc file
@ 2024-01-07 15:41 Srikanth Yalavarthi
2024-10-09 18:44 ` Stephen Hemminger
2024-10-10 13:57 ` Bruce Richardson
0 siblings, 2 replies; 7+ messages in thread
From: Srikanth Yalavarthi @ 2024-01-07 15:41 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, aprabhu, syalavarthi, sshankarnara, ptakkar
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>.
https://github.com/mesonbuild/meson/issues/7766
Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
buildtools/pkg-config/set-static-linker-flags.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/buildtools/pkg-config/set-static-linker-flags.py b/buildtools/pkg-config/set-static-linker-flags.py
index 2745db34c29..e8804353383 100644
--- a/buildtools/pkg-config/set-static-linker-flags.py
+++ b/buildtools/pkg-config/set-static-linker-flags.py
@@ -9,6 +9,8 @@
def fix_ldflag(f):
+ if (f.startswith('/') and (f.endswith('.so') or f.endswith('.a'))):
+ return f.split('/', -1)[-1].split('.', -1)[0].replace('lib', '-l', 1)
if not f.startswith('-lrte_'):
return f
return '-l:lib' + f[2:] + '.a'
--
2.42.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] buildtools: remove absolute paths from pc file
2024-01-07 15:41 [PATCH 1/1] buildtools: remove absolute paths from pc file Srikanth Yalavarthi
@ 2024-10-09 18:44 ` Stephen Hemminger
2024-10-10 8:02 ` Bruce Richardson
2024-10-10 13:57 ` Bruce Richardson
1 sibling, 1 reply; 7+ messages in thread
From: Stephen Hemminger @ 2024-10-09 18:44 UTC (permalink / raw)
To: Srikanth Yalavarthi, Bruce Richardson
Cc: Bruce Richardson, dev, aprabhu, sshankarnara, ptakkar
On Sun, 7 Jan 2024 07:41:36 -0800
Srikanth Yalavarthi <syalavarthi@marvell.com> 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>.
>
> https://github.com/mesonbuild/meson/issues/7766
>
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> ---
Bruce did you look at this?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] buildtools: remove absolute paths from pc file
2024-10-09 18:44 ` Stephen Hemminger
@ 2024-10-10 8:02 ` Bruce Richardson
0 siblings, 0 replies; 7+ messages in thread
From: Bruce Richardson @ 2024-10-10 8:02 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Srikanth Yalavarthi, dev, aprabhu, sshankarnara, ptakkar
On Wed, Oct 09, 2024 at 11:44:12AM -0700, Stephen Hemminger wrote:
> On Sun, 7 Jan 2024 07:41:36 -0800
> Srikanth Yalavarthi <syalavarthi@marvell.com> 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>.
> >
> > https://github.com/mesonbuild/meson/issues/7766
> >
> > Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> > ---
>
> Bruce did you look at this?
No sorry, will take a look at it today.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] buildtools: remove absolute paths from pc file
2024-01-07 15:41 [PATCH 1/1] buildtools: remove absolute paths from pc file Srikanth Yalavarthi
2024-10-09 18:44 ` Stephen Hemminger
@ 2024-10-10 13:57 ` Bruce Richardson
1 sibling, 0 replies; 7+ messages in thread
From: Bruce Richardson @ 2024-10-10 13:57 UTC (permalink / raw)
To: Srikanth Yalavarthi; +Cc: dev, aprabhu, sshankarnara, ptakkar
On Sun, Jan 07, 2024 at 07:41:36AM -0800, 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>.
>
> https://github.com/mesonbuild/meson/issues/7766
>
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> ---
> buildtools/pkg-config/set-static-linker-flags.py | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/buildtools/pkg-config/set-static-linker-flags.py b/buildtools/pkg-config/set-static-linker-flags.py
> index 2745db34c29..e8804353383 100644
> --- a/buildtools/pkg-config/set-static-linker-flags.py
> +++ b/buildtools/pkg-config/set-static-linker-flags.py
> @@ -9,6 +9,8 @@
>
>
> def fix_ldflag(f):
> + if (f.startswith('/') and (f.endswith('.so') or f.endswith('.a'))):
> + return f.split('/', -1)[-1].split('.', -1)[0].replace('lib', '-l', 1)
> if not f.startswith('-lrte_'):
> return f
> return '-l:lib' + f[2:] + '.a'
> --
On initial reading this change looks harmless, however, I'm not exactly
clear where it is needed. What libraries are getting added to the PC files
with full paths?
Also, does this only apply to all versions of meson or has it been fixed in
later ones?
Thanks,
/Bruce
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/1] buildtools: remove absolute paths from pc file
@ 2026-06-09 4:32 Srikanth Yalavarthi
2026-06-09 7:47 ` Bruce Richardson
0 siblings, 1 reply; 7+ messages in thread
From: Srikanth Yalavarthi @ 2026-06-09 4:32 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, Srikanth Yalavarthi
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>.
https://github.com/mesonbuild/meson/issues/7766
Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] buildtools: remove absolute paths from pc file
2026-06-09 4:32 Srikanth Yalavarthi
@ 2026-06-09 7:47 ` Bruce Richardson
2026-06-09 8:09 ` Bruce Richardson
0 siblings, 1 reply; 7+ messages in thread
From: Bruce Richardson @ 2026-06-09 7:47 UTC (permalink / raw)
To: Srikanth Yalavarthi; +Cc: dev
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 <syalavarthi@marvell.com>
> ---
> 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
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] buildtools: remove absolute paths from pc file
2026-06-09 7:47 ` Bruce Richardson
@ 2026-06-09 8:09 ` Bruce Richardson
0 siblings, 0 replies; 7+ messages in thread
From: Bruce Richardson @ 2026-06-09 8:09 UTC (permalink / raw)
To: Srikanth Yalavarthi; +Cc: dev
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
> >
The bug report indicates that this issue only occurs for some libs which
are missing an SONAME. Checking the .pc files generated on my own system, I
don't see any libs listed with full paths. Out of interest, what libraries
are causing problems? (Alternative question - how can we reproduce this
issue to check the fix :-) )
Thanks,
/Bruce
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-06-09 8:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-07 15:41 [PATCH 1/1] buildtools: remove absolute paths from pc file Srikanth Yalavarthi
2024-10-09 18:44 ` Stephen Hemminger
2024-10-10 8:02 ` Bruce Richardson
2024-10-10 13:57 ` Bruce Richardson
-- strict thread matches above, loose matches on Subject: below --
2026-06-09 4:32 Srikanth Yalavarthi
2026-06-09 7:47 ` Bruce Richardson
2026-06-09 8:09 ` Bruce Richardson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox