[PATCH 1/1] buildtools: remove absolute paths from pc file
Bruce Richardson
bruce.richardson at intel.com
Thu Oct 10 15:57:30 CEST 2024
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 at 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
More information about the dev
mailing list