aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/minifi-cpp
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-08-17 16:22:49 -0700
committerKhem Raj <raj.khem@gmail.com>2020-08-17 16:26:14 -0700
commit503d90b608c735c0da42ed99b8fe1667e5c01c56 (patch)
tree216fa5f920e3f178ad973a2665a2f4a4be12cb55 /meta-oe/recipes-extended/minifi-cpp
parent7c6bf8926c67b6849bb86ed6b31458436bc7ddaa (diff)
downloadmeta-openembedded-contrib-503d90b608c735c0da42ed99b8fe1667e5c01c56.tar.gz
minifi-cpp: Fix build with lto/clang
Define CMAKE_RANLIN to llvm-ranlib and use lld for linking since it detects LTO use for civetweb and therefore archives (.a) should be creatd is compiler ar/ranlib and gold or lld be used. backport a patch to fix build with clang, this patch is already proposed via [1] [1] https://github.com/facebook/rocksdb/pull/7265 Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-extended/minifi-cpp')
-rw-r--r--meta-oe/recipes-extended/minifi-cpp/files/remove_const_due_to_std_lock_guard.patch38
-rw-r--r--meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb3
2 files changed, 41 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/minifi-cpp/files/remove_const_due_to_std_lock_guard.patch b/meta-oe/recipes-extended/minifi-cpp/files/remove_const_due_to_std_lock_guard.patch
new file mode 100644
index 0000000000..2d66576f6e
--- /dev/null
+++ b/meta-oe/recipes-extended/minifi-cpp/files/remove_const_due_to_std_lock_guard.patch
@@ -0,0 +1,38 @@
+From bfce136fa9ff1e955928539484ba4dd55f98f05b Mon Sep 17 00:00:00 2001
+From: Willem Jan Withagen <wjw@digiware.nl>
+Date: Sun, 16 Aug 2020 23:38:55 +0200
+Subject: [PATCH] Update channel.h
+
+Compiling this on FreeBSD with CLang fails due to:
+```In file included from /usr/ports/net/ceph15/work/ceph-15.2.4/src/rocksdb/utilities/backupable/backupable_db.cc:16:
+/usr/ports/net/ceph15/work/ceph-15.2.4/src/rocksdb/util/channel.h:35:33: error: no matching constructor for initialization of 'std::lock_guard<std::mutex>'
+ std::lock_guard<std::mutex> lk(lock_);
+ ^ ~~~~~
+/usr/include/c++/v1/__mutex_base:90:14: note: candidate constructor not viable: 1st argument ('const std::mutex') would lose const qualifier
+ explicit lock_guard(mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
+ ^
+/usr/include/c++/v1/__mutex_base:100:5: note: candidate constructor not viable: no known conversion from 'const std::mutex' to 'const std::__1::lock_guard<std::__1::mutex>' for 1st argument
+ lock_guard(lock_guard const&) _LIBCPP_EQUAL_DELETE;
+ ^
+/usr/include/c++/v1/__mutex_base:94:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
+ lock_guard(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
+ ^
+1 error generated.
+```
+---
+ thirdparty/rocksdb/util/channel.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/thirdparty/rocksdb/util/channel.h b/thirdparty/rocksdb/util/channel.h
+index 705fa2d28f..993bef5bc0 100644
+--- a/thirdparty/rocksdb/util/channel.h
++++ b/thirdparty/rocksdb/util/channel.h
+@@ -31,7 +31,7 @@ class channel {
+ return buffer_.empty() && eof_;
+ }
+
+- size_t size() const {
++ size_t size() {
+ std::lock_guard<std::mutex> lk(lock_);
+ return buffer_.size();
+ }
diff --git a/meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb b/meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb
index 150d1fa53c..92baa98314 100644
--- a/meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb
+++ b/meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb
@@ -19,6 +19,7 @@ SRC_URI = "git://github.com/apache/nifi-minifi-cpp.git \
file://fix-osspuuid-cross-compile.patch \
file://fix-osspuuid-musl-compile.patch \
file://fix-rocksdb-cross-compile.patch \
+ file://remove_const_due_to_std_lock_guard.patch \
file://minifi.service \
file://systemd-volatile.conf \
file://sysvinit-volatile.conf \
@@ -37,6 +38,8 @@ EXTRA_OECMAKE += " \
-DHOST_SYS=${HOST_SYS} -DBUILD_SYS=${BUILD_SYS} \
-DSKIP_TESTS=ON \
"
+EXTRA_OECMAKE_append_toolchain-clang = " -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib"
+LDFLAGS_append_toolchain-clang = " -fuse-ld=lld"
# There are endian issues when communicating with the x86 nifi on the the mips and the ppc machines.
COMPATIBLE_MACHINE_mips = "(!.*mips).*"