patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 1/1] build: update link args and includes for libarchive
@ 2023-10-20 17:01 Srikanth Yalavarthi
  2023-10-23  9:26 ` Bruce Richardson
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Srikanth Yalavarthi @ 2023-10-20 17:01 UTC (permalink / raw)
  To: Bruce Richardson, Aaron Conole, Igor Russkikh, David Marchand
  Cc: dev, syalavarthi, sshankarnara, jerinj, stable

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>
---
 config/meson.build  | 1 +
 lib/eal/meson.build | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/config/meson.build b/config/meson.build
index d56b0f9bce..1bacea74ab 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -239,6 +239,7 @@ if libarchive.found()
     # Push libarchive link dependency at the project level to support
     # statically linking dpdk apps. Details at:
     # https://inbox.dpdk.org/dev/20210605004024.660267a1@sovereign/
+    add_project_link_arguments('-L' + libarchive.get_variable(pkgconfig: 'libdir'), language: 'c')
     add_project_link_arguments('-larchive', language: 'c')
     dpdk_extra_ldflags += '-larchive'
 endif
diff --git a/lib/eal/meson.build b/lib/eal/meson.build
index 9942104386..741a5cd088 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')
+    includes += include_directories(libarchive.get_variable(pkgconfig: 'includedir'))
+endif
 if cc.has_function('getentropy', prefix : '#include <unistd.h>')
     cflags += '-DRTE_LIBEAL_USE_GETENTROPY'
 endif
-- 
2.42.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2023-11-06 18:17 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-20 17:01 [PATCH 1/1] build: update link args and includes for libarchive 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
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

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).