diff mbox series

[meta-oe] minifi-cpp: Fix build with clang and riscv32

Message ID 20240530035938.2567678-1-raj.khem@gmail.com
State New
Headers show
Series [meta-oe] minifi-cpp: Fix build with clang and riscv32 | expand

Commit Message

Khem Raj May 30, 2024, 3:59 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...-mutex_-to-mtx_-member-of-Concurrent.patch | 37 +++++++++++++++++++
 .../minifi-cpp/minifi-cpp_0.15.0.bb           |  3 ++
 2 files changed, 40 insertions(+)
 create mode 100644 meta-oe/recipes-extended/minifi-cpp/files/0001-libminifi-Rename-mutex_-to-mtx_-member-of-Concurrent.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/minifi-cpp/files/0001-libminifi-Rename-mutex_-to-mtx_-member-of-Concurrent.patch b/meta-oe/recipes-extended/minifi-cpp/files/0001-libminifi-Rename-mutex_-to-mtx_-member-of-Concurrent.patch
new file mode 100644
index 0000000000..a09a17bf2c
--- /dev/null
+++ b/meta-oe/recipes-extended/minifi-cpp/files/0001-libminifi-Rename-mutex_-to-mtx_-member-of-Concurrent.patch
@@ -0,0 +1,37 @@ 
+From cd2b5362fe2e63dff3666ce72da27979fe06a519 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 May 2024 22:24:52 -0700
+Subject: [PATCH] libminifi: Rename mutex_ to mtx_ member of ConcurrentQueue
+
+Fixes
+libminifi/include/utils/MinifiConcurrentQueue.h:48:75: error: no member named 'mutex_' in 'ConcurrentQueue<T>'; did you mean 'mtx_'?
+|    48 |     : ConcurrentQueue(std::move(other), std::lock_guard<std::mutex>(other.mutex_)) {}
+|       |                                                                           ^~~~~~
+|       |                                                                           mtx_
+| libminifi/include/utils/MinifiConcurrentQueue.h:140:22: note: 'mtx_' declared here
+|   140 |   mutable std::mutex mtx_;
+|       |                      ^
+| 1 error generated.
+
+Upstream-Status: Submitted [https://github.com/apache/nifi-minifi-cpp/pull/1803]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libminifi/include/utils/MinifiConcurrentQueue.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libminifi/include/utils/MinifiConcurrentQueue.h b/libminifi/include/utils/MinifiConcurrentQueue.h
+index 8abc0ec93..1db58080b 100644
+--- a/libminifi/include/utils/MinifiConcurrentQueue.h
++++ b/libminifi/include/utils/MinifiConcurrentQueue.h
+@@ -45,7 +45,7 @@ class ConcurrentQueue {
+   ConcurrentQueue(const ConcurrentQueue& other) = delete;
+   ConcurrentQueue& operator=(const ConcurrentQueue& other) = delete;
+   ConcurrentQueue(ConcurrentQueue&& other)
+-    : ConcurrentQueue(std::move(other), std::lock_guard<std::mutex>(other.mutex_)) {}
++    : ConcurrentQueue(std::move(other), std::lock_guard<std::mutex>(other.mtx_)) {}
+ 
+   ConcurrentQueue& operator=(ConcurrentQueue&& other) {
+     if (this != &other) {
+-- 
+2.45.1
+
diff --git a/meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.15.0.bb b/meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.15.0.bb
index c9b369f0a6..fca8d9e754 100644
--- a/meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.15.0.bb
+++ b/meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.15.0.bb
@@ -27,6 +27,7 @@  SRC_URI = "git://github.com/apache/nifi-minifi-cpp.git;protocol=https;branch=mai
            file://0006-OsUtils.h-add-missing-header-cstdint-for-int64_t.patch \
            file://0007-CMakeLists.txt-do-not-use-ccache.patch \
            file://0008-libsodium-aarch64_crypto.patch \
+           file://0001-libminifi-Rename-mutex_-to-mtx_-member-of-Concurrent.patch \
            file://systemd-volatile.conf \
            file://sysvinit-volatile.conf \
           "
@@ -55,6 +56,8 @@  DEPENDS = "virtual/crypt bison-native flex-native flex openssl curl zlib xz bzip
 
 OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH"
 
+LDFLAGS:append:riscv32 = " -latomic"
+
 EXTRA_OECMAKE = " \
                  -DCMAKE_BUILD_TYPE=Release \
                  -DHOST_SYS=${HOST_SYS} -DBUILD_SYS=${BUILD_SYS} \