From: Mohamad Noor Alim Hussin <[email protected]>

The generated pkg-config libdpdk.pc file has the output
with full path of librt such as
<builddir>/recipe-sysroot/usr/lib/librt.so
instead of -lrt.

This will cause an issue when compile DPDK app
with static library as the librt is not found with the
hardcode path in the libdpdk.pc file.

Signed-off-by: Mohamad Noor Alim Hussin <[email protected]>
---
 ...Fix-finding-librt-using-find_library.patch | 35 +++++++++++++++++++
 recipes-extended/dpdk/dpdk_20.11.1.bb         |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 
recipes-extended/dpdk/dpdk/0001-ifpga-meson-Fix-finding-librt-using-find_library.patch

diff --git 
a/recipes-extended/dpdk/dpdk/0001-ifpga-meson-Fix-finding-librt-using-find_library.patch
 
b/recipes-extended/dpdk/dpdk/0001-ifpga-meson-Fix-finding-librt-using-find_library.patch
new file mode 100644
index 0000000..4df28c4
--- /dev/null
+++ 
b/recipes-extended/dpdk/dpdk/0001-ifpga-meson-Fix-finding-librt-using-find_library.patch
@@ -0,0 +1,35 @@
+From 308409d72671b7978b20d40748ad985a235b6c86 Mon Sep 17 00:00:00 2001
+From: Mohamad Noor Alim Hussin <[email protected]>
+Date: Thu, 24 Jun 2021 11:30:09 +0800
+Subject: [PATCH] ifpga/meson: Fix finding librt using find_library()
+
+Finding with "librt" keyword would give the output
+with full path of librt such as /usr/lib/librt.so
+instead of -lrt.
+
+Assume find_library() will prepend "lib", thus remove
+"lib" from "librt" keyword. The output will shows as
+-lrt.
+
+Upstream-Status: Submitted 
[https://mails.dpdk.org/archives/stable/2021-June/031840.html]
+
+Signed-off-by: Mohamad Noor Alim Hussin <[email protected]>
+---
+ drivers/raw/ifpga/base/meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/raw/ifpga/base/meson.build 
b/drivers/raw/ifpga/base/meson.build
+index da2d6e33c..949f7f127 100644
+--- a/drivers/raw/ifpga/base/meson.build
++++ b/drivers/raw/ifpga/base/meson.build
+@@ -25,7 +25,7 @@ sources = [
+
+ rtdep = dependency('librt', required: false)
+ if not rtdep.found()
+-      rtdep = cc.find_library('librt', required: false)
++      rtdep = cc.find_library('rt', required: false)
+ endif
+ if not rtdep.found()
+       build = false
+--
+2.32.0
diff --git a/recipes-extended/dpdk/dpdk_20.11.1.bb 
b/recipes-extended/dpdk/dpdk_20.11.1.bb
index d96fd8b..19e8bcc 100644
--- a/recipes-extended/dpdk/dpdk_20.11.1.bb
+++ b/recipes-extended/dpdk/dpdk_20.11.1.bb
@@ -2,6 +2,7 @@ include dpdk.inc
 
 SRC_URI += " \
             
file://0001-meson.build-march-and-mcpu-already-passed-by-Yocto.patch \
+            file://0001-ifpga-meson-Fix-finding-librt-using-find_library.patch 
\
 "
 
 STABLE = "-stable"
-- 
2.32.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7120): 
https://lists.yoctoproject.org/g/meta-intel/message/7120
Mute This Topic: https://lists.yoctoproject.org/mt/83757062/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to