diff options
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-dbs/rocksdb')
3 files changed, 121 insertions, 40 deletions
diff --git a/meta-openembedded/meta-oe/recipes-dbs/rocksdb/files/0001-Fix-build-breakage-from-lock_guard-error-6161.patch b/meta-openembedded/meta-oe/recipes-dbs/rocksdb/files/0001-Fix-build-breakage-from-lock_guard-error-6161.patch deleted file mode 100644 index ac87d0c60d..0000000000 --- a/meta-openembedded/meta-oe/recipes-dbs/rocksdb/files/0001-Fix-build-breakage-from-lock_guard-error-6161.patch +++ /dev/null @@ -1,36 +0,0 @@ -From b626703de7ece507f360507e49d3ecb448b12e07 Mon Sep 17 00:00:00 2001 -From: Maysam Yabandeh <myabandeh@fb.com> -Date: Thu, 12 Dec 2019 13:48:50 -0800 -Subject: [PATCH] Fix build breakage from lock_guard error (#6161) - -Summary: -This change fixes a source issue that caused compile time error which breaks build for many fbcode services in that setup. The size() member function of channel is a const member, so member variables accessed within it are implicitly const as well. This caused error when clang fails to resolve to a constructor that takes std::mutex because the suitable constructor got rejected due to loss of constness for its argument. The fix is to add mutable modifier to the lock_ member of channel. -Pull Request resolved: https://github.com/facebook/rocksdb/pull/6161 - -Differential Revision: D18967685 - -Pulled By: maysamyabandeh - -Upstream-Status: Backport - -fbshipit-source-id: 698b6a5153c3c92eeacb842c467aa28cc350d432 ---- - util/channel.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/util/channel.h b/util/channel.h -index 0225482c0..a8a47680a 100644 ---- a/util/channel.h -+++ b/util/channel.h -@@ -60,7 +60,7 @@ class channel { - - private: - std::condition_variable cv_; -- std::mutex lock_; -+ mutable std::mutex lock_; - std::queue<T> buffer_; - bool eof_; - }; --- -2.24.1 - diff --git a/meta-openembedded/meta-oe/recipes-dbs/rocksdb/files/0001-cmake-Add-check-for-atomic-support.patch b/meta-openembedded/meta-oe/recipes-dbs/rocksdb/files/0001-cmake-Add-check-for-atomic-support.patch new file mode 100644 index 0000000000..9bfb1f31d9 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/rocksdb/files/0001-cmake-Add-check-for-atomic-support.patch @@ -0,0 +1,115 @@ +From ba0a0e54d9544babbd3963891f4e3200dd5583f5 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 18 Mar 2020 15:10:37 -0700 +Subject: [PATCH] cmake: Add check for atomic support + +Detect if libatomic should be linked in or compiler and platform can +provide the needed atomic instrinsics, this helps build on certain +platforms like mips or clang/i386 + +Fixes + +| /mnt/b/yoe/build/tmp/work/mips32r2-yoe-linux/rocksdb/6.6.4-r0/recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-ld: librocksdb.so.6.6.4: undefined reference to `__atomic_exchange_8' +| /mnt/b/yoe/build/tmp/work/mips32r2-yoe-linux/rocksdb/6.6.4-r0/recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-ld: librocksdb.so.6.6.4: undefined reference to `__atomic_fetch_or_8' +| /mnt/b/yoe/build/tmp/work/mips32r2-yoe-linux/rocksdb/6.6.4-r0/recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-ld: librocksdb.so.6.6.4: undefined reference to `__atomic_compare_exchange_8' +| /mnt/b/yoe/build/tmp/work/mips32r2-yoe-linux/rocksdb/6.6.4-r0/recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-ld: librocksdb.so.6.6.4: undefined reference to `__atomic_fetch_sub_8' +| /mnt/b/yoe/build/tmp/work/mips32r2-yoe-linux/rocksdb/6.6.4-r0/recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-ld: librocksdb.so.6.6.4: undefined reference to `__atomic_load_8' +| /mnt/b/yoe/build/tmp/work/mips32r2-yoe-linux/rocksdb/6.6.4-r0/recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-ld: librocksdb.so.6.6.4: undefined reference to `__atomic_store_8' +| /mnt/b/yoe/build/tmp/work/mips32r2-yoe-linux/rocksdb/6.6.4-r0/recipe-sysroot-native/usr/bin/mips-yoe-linux/mips-yoe-linux-ld: librocksdb.so.6.6.4: undefined reference to `__atomic_fetch_add_8' + +Upstream-Status: Submitted [https://github.com/facebook/rocksdb/pull/6555] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + CMakeLists.txt | 6 +++ + cmake/modules/CheckAtomic.cmake | 69 +++++++++++++++++++++++++++++++++ + 2 files changed, 75 insertions(+) + create mode 100644 cmake/modules/CheckAtomic.cmake + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -780,7 +780,13 @@ if(WIN32) + set(SYSTEM_LIBS ${SYSTEM_LIBS} shlwapi.lib rpcrt4.lib) + set(LIBS ${ROCKSDB_STATIC_LIB} ${THIRDPARTY_LIBS} ${SYSTEM_LIBS}) + else() ++ # check if linking against libatomic is necessary ++ include(CheckAtomic) ++ + set(SYSTEM_LIBS ${CMAKE_THREAD_LIBS_INIT}) ++ if(HAVE_CXX_ATOMIC_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB) ++ set(SYSTEM_LIBS ${SYSTEM_LIBS} atomic) ++ endif() + set(LIBS ${ROCKSDB_SHARED_LIB} ${THIRDPARTY_LIBS} ${SYSTEM_LIBS}) + + add_library(${ROCKSDB_SHARED_LIB} SHARED ${SOURCES}) +--- /dev/null ++++ b/cmake/modules/CheckAtomic.cmake +@@ -0,0 +1,69 @@ ++# Checks if atomic operations are supported natively or if linking against ++# libatomic is needed. ++ ++# Check inspired by LLVMs cmake/modules/CheckAtomic.cmake ++ ++INCLUDE(CheckCXXSourceCompiles) ++INCLUDE(CheckLibraryExists) ++ ++function(check_working_cxx_atomics varname) ++ set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) ++ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++11") ++ CHECK_CXX_SOURCE_COMPILES(" ++#include <atomic> ++std::atomic<int> x; ++int main() { ++ return x; ++} ++" ${varname}) ++ set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) ++endfunction(check_working_cxx_atomics) ++ ++function(check_working_cxx_atomics64 varname) ++ set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) ++ set(CMAKE_REQUIRED_FLAGS "-std=c++11 ${CMAKE_REQUIRED_FLAGS}") ++ CHECK_CXX_SOURCE_COMPILES(" ++#include <atomic> ++#include <cstdint> ++std::atomic<uint64_t> x (0); ++std::atomic<double> y (0); ++int main() { ++ uint64_t i = x.load(std::memory_order_relaxed); ++ return int(y); ++} ++" ${varname}) ++ set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) ++endfunction(check_working_cxx_atomics64) ++ ++# Check if atomics work without libatomic ++check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITHOUT_LIB) ++ ++if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB) ++ check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC) ++ if( HAVE_LIBATOMIC ) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") ++ check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITH_LIB) ++ if (NOT HAVE_CXX_ATOMICS_WITH_LIB) ++ message(FATAL_ERROR "Host compiler must support std::atomic!") ++ endif() ++ else() ++ message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.") ++ endif() ++endif() ++ ++# Check if 64bit atomics work without libatomic ++check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB) ++ ++if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB) ++ check_library_exists(atomic __atomic_load_8 "" HAVE_CXX_LIBATOMICS64) ++ if(HAVE_CXX_LIBATOMICS64) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") ++ check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITH_LIB) ++ if (NOT HAVE_CXX_ATOMICS64_WITH_LIB) ++ message(FATAL_ERROR "Host compiler must support std::atomic!") ++ endif() ++ else() ++ message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.") ++ endif() ++endif() ++ diff --git a/meta-openembedded/meta-oe/recipes-dbs/rocksdb/rocksdb_git.bb b/meta-openembedded/meta-oe/recipes-dbs/rocksdb/rocksdb_git.bb index 713d5bb145..b9038df81d 100644 --- a/meta-openembedded/meta-oe/recipes-dbs/rocksdb/rocksdb_git.bb +++ b/meta-openembedded/meta-oe/recipes-dbs/rocksdb/rocksdb_git.bb @@ -6,13 +6,13 @@ LIC_FILES_CHKSUM = "file://LICENSE.Apache;md5=3b83ef96387f14655fc854ddc3c6bd57 \ file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ file://LICENSE.leveldb;md5=fb04ff57a14f308f2eed4a9b87d45837" -SRCREV = "4cfbd87afd08a16df28436fb990ef6b154ee6114" -SRCBRANCH = "6.5.fb" -PV = "6.5.2" +SRCREV = "551a110918493a19d11243f53408b97485de1411" +SRCBRANCH = "6.6.fb" +PV = "6.6.4" SRC_URI = "git://github.com/facebook/${BPN}.git;branch=${SRCBRANCH} \ - file://0001-Fix-build-breakage-from-lock_guard-error-6161.patch \ file://0001-db-write_thread.cc-Initialize-state.patch \ + file://0001-cmake-Add-check-for-atomic-support.patch \ " S = "${WORKDIR}/git" @@ -39,3 +39,5 @@ do_install_append() { # fix for qa check buildpaths sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/cmake/rocksdb/RocksDBTargets.cmake } + +LDFLAGS_append_riscv64 = " -pthread" |