summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-dbs/rocksdb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-dbs/rocksdb')
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/0001-CMakeLists.txt-Make-the-test-discovery-occur-on-targ.patch42
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/0001-Fix-build-error-with-gcc-13-by-adding-cstdint-header.patch65
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/0001-checkpoint.h-Add-missing-includes-cstdint.patch41
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/run-ptest12
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/static_library_as_option.patch71
-rw-r--r--meta-oe/recipes-dbs/rocksdb/rocksdb_9.10.0.bb (renamed from meta-oe/recipes-dbs/rocksdb/rocksdb_9.0.0.bb)30
6 files changed, 256 insertions, 5 deletions
diff --git a/meta-oe/recipes-dbs/rocksdb/files/0001-CMakeLists.txt-Make-the-test-discovery-occur-on-targ.patch b/meta-oe/recipes-dbs/rocksdb/files/0001-CMakeLists.txt-Make-the-test-discovery-occur-on-targ.patch
new file mode 100644
index 0000000000..b0a949fe31
--- /dev/null
+++ b/meta-oe/recipes-dbs/rocksdb/files/0001-CMakeLists.txt-Make-the-test-discovery-occur-on-targ.patch
@@ -0,0 +1,42 @@
1From 9abf6cd09c60f0be9a85c055dfdf43698f057f73 Mon Sep 17 00:00:00 2001
2From: Mingli Yu <mingli.yu@windriver.com>
3Date: Wed, 25 Sep 2024 13:47:37 +0800
4Subject: [PATCH] CMakeLists.txt: Make the test discovery occur on target
5
6Set DISCOVERY_MODE to PRE_TEST to delay test discovery until just
7prior to test execution on the target to fix the build failure as
8the default POST_BUILD behavior is not desirable in cross-compiling
9env.
10
11/build/tmp/work/core2-64-wrs-linux/rocksdb/9.0.0/build/env_basic_test: error while loading shared libraries: libgflags.so.2.2: cannot open shared object file: No such file or directory
12CMake Error at /build/tmp/work/core2-64-wrs-linux/rocksdb/9.0.0/recipe-sysroot-native/usr/share/cmake-3.30/Modules/GoogleTestAddTests.cmake:112 (message):
13 Error running test executable.
14
15 Path: '/build/tmp/work/core2-64-wrs-linux/rocksdb/9.0.0/build/env_basic_test'
16 Working directory: '/build/tmp/work/core2-64-wrs-linux/rocksdb/9.0.0/build'
17 Result: 127
18 Output:
19
20Upstream-Status: Inappropriate [oe specific]
21
22Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
23---
24 CMakeLists.txt | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27diff --git a/CMakeLists.txt b/CMakeLists.txt
28index 403ad1243..f34397798 100644
29--- a/CMakeLists.txt
30+++ b/CMakeLists.txt
31@@ -1502,7 +1502,7 @@ if(WITH_TESTS)
32 )
33 target_link_libraries(${exename}${ARTIFACT_SUFFIX} testutillib${ARTIFACT_SUFFIX} testharness gtest ${THIRDPARTY_LIBS} ${ROCKSDB_LIB})
34 if(NOT "${exename}" MATCHES "db_sanity_test")
35- gtest_discover_tests(${exename} DISCOVERY_TIMEOUT 120)
36+ gtest_discover_tests(${exename} DISCOVERY_TIMEOUT 120 DISCOVERY_MODE PRE_TEST)
37 add_dependencies(rocksdb_check ${exename}${ARTIFACT_SUFFIX})
38 endif()
39 endforeach(sourcefile ${TESTS})
40--
412.34.1
42
diff --git a/meta-oe/recipes-dbs/rocksdb/files/0001-Fix-build-error-with-gcc-13-by-adding-cstdint-header.patch b/meta-oe/recipes-dbs/rocksdb/files/0001-Fix-build-error-with-gcc-13-by-adding-cstdint-header.patch
new file mode 100644
index 0000000000..168bd76ac7
--- /dev/null
+++ b/meta-oe/recipes-dbs/rocksdb/files/0001-Fix-build-error-with-gcc-13-by-adding-cstdint-header.patch
@@ -0,0 +1,65 @@
1From 90eba5458cb4ac2f83cac8aa550927876e6a9a09 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= <lnicola@dend.ro>
3Date: Wed, 5 Mar 2025 15:42:46 +0200
4Subject: [PATCH] Add missing include (#13365)
5
6* see more details: http://errors.yoctoproject.org/Errors/Details/851177/
7In file included from TOPDIR/tmp/work/core2-64-oe-linux/rocksdb/9.10.0/git/db/blob/blob_file_meta.cc:6:
8TOPDIR/tmp/work/core2-64-oe-linux/rocksdb/9.10.0/git/db/blob/blob_file_meta.h:28:7: error: 'uint64_t' has not been declared
9 28 | uint64_t blob_file_number, uint64_t total_blob_count,
10 | ^~~~~~~~
11TOPDIR/tmp/work/core2-64-oe-linux/rocksdb/9.10.0/git/db/blob/blob_file_meta.h:15:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
12 14 | #include "rocksdb/rocksdb_namespace.h"
13 +++ |+#include <cstdint>
14 15 |
15TOPDIR/tmp/work/core2-64-oe-linux/rocksdb/9.10.0/git/db/blob/blob_file_meta.h:28:34: error: 'uint64_t' has not been declared
16 28 | uint64_t blob_file_number, uint64_t total_blob_count,
17 | ^~~~~~~~
18...
19
20* See also: https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
21
22Upstream-Status: Submitted [https://github.com/facebook/rocksdb/pull/13437]
23Signed-off-by: mark.yang <mark.yang@lge.com>
24---
25 db/blob/blob_file_meta.h | 1 +
26 include/rocksdb/trace_record.h | 1 +
27 include/rocksdb/write_batch_base.h | 1 +
28 3 files changed, 3 insertions(+)
29
30diff --git a/db/blob/blob_file_meta.h b/db/blob/blob_file_meta.h
31index d7c8a1243..2e47726f8 100644
32--- a/db/blob/blob_file_meta.h
33+++ b/db/blob/blob_file_meta.h
34@@ -6,6 +6,7 @@
35 #pragma once
36
37 #include <cassert>
38+#include <cstdint>
39 #include <iosfwd>
40 #include <memory>
41 #include <string>
42diff --git a/include/rocksdb/trace_record.h b/include/rocksdb/trace_record.h
43index 8f9c3ee2f..d321f5387 100644
44--- a/include/rocksdb/trace_record.h
45+++ b/include/rocksdb/trace_record.h
46@@ -5,6 +5,7 @@
47
48 #pragma once
49
50+#include <cstdint>
51 #include <memory>
52 #include <string>
53 #include <vector>
54diff --git a/include/rocksdb/write_batch_base.h b/include/rocksdb/write_batch_base.h
55index 3334a1292..43b186029 100644
56--- a/include/rocksdb/write_batch_base.h
57+++ b/include/rocksdb/write_batch_base.h
58@@ -9,6 +9,7 @@
59 #pragma once
60
61 #include <cstddef>
62+#include <cstdint>
63
64 #include "rocksdb/attribute_groups.h"
65 #include "rocksdb/rocksdb_namespace.h"
diff --git a/meta-oe/recipes-dbs/rocksdb/files/0001-checkpoint.h-Add-missing-includes-cstdint.patch b/meta-oe/recipes-dbs/rocksdb/files/0001-checkpoint.h-Add-missing-includes-cstdint.patch
new file mode 100644
index 0000000000..a872be5b54
--- /dev/null
+++ b/meta-oe/recipes-dbs/rocksdb/files/0001-checkpoint.h-Add-missing-includes-cstdint.patch
@@ -0,0 +1,41 @@
1From 31012cdfa435d9203da3c3de8127b66bf018692a Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 24 Jan 2023 21:40:43 -0800
4Subject: [PATCH] checkpoint.h: Add missing includes <cstdint>
5
6It uses uint64_t and it comes from <cstdint>
7This is needed with GCC 13 and newer [1]
8
9[1] https://www.gnu.org/software/gcc/gcc-13/porting_to.html
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12
13* build error:
14FAILED: CMakeFiles/checkpoint_test.dir/utilities/checkpoint/checkpoint_test.cc.o
15In file included from rocksdb/9.10.0/git/utilities/checkpoint/checkpoint_test.cc:11:
16rocksdb/9.10.0/git/include/rocksdb/utilities/checkpoint.h:49:35: error: 'uint64_t' has not been declared
17 49 | uint64_t log_size_for_flush = 0,
18 | ^~~~~~~~
19rocksdb/9.10.0/git/include/rocksdb/utilities/checkpoint.h:14:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
20 13 | #include "rocksdb/status.h"
21 +++ |+#include <cstdint>
22 14 |
23
24Upstream-Status: Submitted [https://github.com/facebook/rocksdb/pull/11137]
25Signed-off-by: mark.yang <mark.yang@lge.com>
26---
27 include/rocksdb/utilities/checkpoint.h | 1 +
28 1 file changed, 1 insertion(+)
29
30Index: git/include/rocksdb/utilities/checkpoint.h
31===================================================================
32--- git.orig/include/rocksdb/utilities/checkpoint.h
33+++ git/include/rocksdb/utilities/checkpoint.h
34@@ -7,6 +7,7 @@
35
36 #pragma once
37
38+#include <cstdint>
39 #include <string>
40 #include <vector>
41
diff --git a/meta-oe/recipes-dbs/rocksdb/files/run-ptest b/meta-oe/recipes-dbs/rocksdb/files/run-ptest
new file mode 100644
index 0000000000..45406fdfa1
--- /dev/null
+++ b/meta-oe/recipes-dbs/rocksdb/files/run-ptest
@@ -0,0 +1,12 @@
1#!/bin/sh
2ptestdir=$(dirname "$(readlink -f "$0")")
3cd "$ptestdir"/tests || exit
4
5for test in *_test; do
6 if ./${test} >/dev/null 2>&1; then
7 echo "PASS: ${test}"
8 else
9 echo "FAIL: ${test}"
10 fi
11done
12
diff --git a/meta-oe/recipes-dbs/rocksdb/files/static_library_as_option.patch b/meta-oe/recipes-dbs/rocksdb/files/static_library_as_option.patch
new file mode 100644
index 0000000000..9a85e8db45
--- /dev/null
+++ b/meta-oe/recipes-dbs/rocksdb/files/static_library_as_option.patch
@@ -0,0 +1,71 @@
1From 285d306494bde3e9c24c8cd6fea1eb380a304d03 Mon Sep 17 00:00:00 2001
2From: Bindu-Bhabu <bindudaniel1996@gmail.com>
3Date: Fri, 26 Jul 2024 15:14:45 +0530
4Subject: Add option to CMake for building static libraries
5
6ROCKSDB creates a STATIC library target reference by default.
7Modify the cmake so that the STATIC library is also an option
8just like creating a SHARED library and set default to ON.
9
10Upstream-Status: Submitted [https://github.com/facebook/rocksdb/pull/12890]
11
12Signed-off-by: Nisha Parrakat <nisha.m.parrakat@bmw.de>
13Signed-off-by: Bindu Bhabu <bhabu.bindu@kpit.com>
14---
15 CMakeLists.txt | 29 +++++++++++++++++------------
16 1 file changed, 17 insertions(+), 12 deletions(-)
17
18diff --git a/CMakeLists.txt b/CMakeLists.txt
19index 93b884dd9c1..2ca925d505c 100644
20--- a/CMakeLists.txt
21+++ b/CMakeLists.txt
22@@ -98,6 +98,7 @@ if (WITH_WINDOWS_UTF8_FILENAMES)
23 add_definitions(-DROCKSDB_WINDOWS_UTF8_FILENAMES)
24 endif()
25 option(ROCKSDB_BUILD_SHARED "Build shared versions of the RocksDB libraries" ON)
26+option(ROCKSDB_BUILD_STATIC "Build static versions of the RocksDB libraries" ON)
27
28 if( NOT DEFINED CMAKE_CXX_STANDARD )
29 set(CMAKE_CXX_STANDARD 17)
30@@ -1139,11 +1140,13 @@ string(REGEX REPLACE "[^0-9: /-]+" "" GIT_DATE "${GIT_DATE}")
31 set(BUILD_VERSION_CC ${CMAKE_BINARY_DIR}/build_version.cc)
32 configure_file(util/build_version.cc.in ${BUILD_VERSION_CC} @ONLY)
33
34-add_library(${ROCKSDB_STATIC_LIB} STATIC ${SOURCES} ${BUILD_VERSION_CC})
35-target_include_directories(${ROCKSDB_STATIC_LIB} PUBLIC
36- $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
37-target_link_libraries(${ROCKSDB_STATIC_LIB} PRIVATE
38- ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
39+if(ROCKSDB_BUILD_STATIC)
40+ add_library(${ROCKSDB_STATIC_LIB} STATIC ${SOURCES} ${BUILD_VERSION_CC})
41+ target_include_directories(${ROCKSDB_STATIC_LIB} PUBLIC
42+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
43+ target_link_libraries(${ROCKSDB_STATIC_LIB} PRIVATE
44+ ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
45+endif()
46
47 if(ROCKSDB_BUILD_SHARED)
48 add_library(${ROCKSDB_SHARED_LIB} SHARED ${SOURCES} ${BUILD_VERSION_CC})
49@@ -1238,13 +1241,15 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS)
50
51 install(DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/modules" COMPONENT devel DESTINATION ${package_config_destination})
52
53- install(
54- TARGETS ${ROCKSDB_STATIC_LIB}
55- EXPORT RocksDBTargets
56- COMPONENT devel
57- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
58- INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
59- )
60+ if(ROCKSDB_BUILD_STATIC)
61+ install(
62+ TARGETS ${ROCKSDB_STATIC_LIB}
63+ EXPORT RocksDBTargets
64+ COMPONENT devel
65+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
66+ INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
67+ )
68+ endif()
69
70 if(ROCKSDB_BUILD_SHARED)
71 install(
diff --git a/meta-oe/recipes-dbs/rocksdb/rocksdb_9.0.0.bb b/meta-oe/recipes-dbs/rocksdb/rocksdb_9.10.0.bb
index 444351dbb4..5bbb010f8b 100644
--- a/meta-oe/recipes-dbs/rocksdb/rocksdb_9.0.0.bb
+++ b/meta-oe/recipes-dbs/rocksdb/rocksdb_9.10.0.bb
@@ -6,8 +6,8 @@ LIC_FILES_CHKSUM = "file://LICENSE.Apache;md5=3b83ef96387f14655fc854ddc3c6bd57 \
6 file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ 6 file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
7 file://LICENSE.leveldb;md5=fb04ff57a14f308f2eed4a9b87d45837" 7 file://LICENSE.leveldb;md5=fb04ff57a14f308f2eed4a9b87d45837"
8 8
9SRCREV = "f4441966592636253fd5ab0bb9ed44fc2697fc53" 9SRCREV = "ae8fb3e5000e46d8d4c9dbf3a36019c0aaceebff"
10SRCBRANCH = "9.0.fb" 10SRCBRANCH = "9.10.fb"
11 11
12SRC_URI = "git://github.com/facebook/${BPN}.git;branch=${SRCBRANCH};protocol=https \ 12SRC_URI = "git://github.com/facebook/${BPN}.git;branch=${SRCBRANCH};protocol=https \
13 file://0001-cmake-Add-check-for-atomic-support.patch \ 13 file://0001-cmake-Add-check-for-atomic-support.patch \
@@ -17,6 +17,11 @@ SRC_URI = "git://github.com/facebook/${BPN}.git;branch=${SRCBRANCH};protocol=htt
17 file://0005-Implement-timer-implementation-for-mips-platform.patch \ 17 file://0005-Implement-timer-implementation-for-mips-platform.patch \
18 file://0006-Implement-timer-for-arm-v6.patch \ 18 file://0006-Implement-timer-for-arm-v6.patch \
19 file://0007-Fix-declaration-scope-of-LE_LOAD32-in-crc32c.patch \ 19 file://0007-Fix-declaration-scope-of-LE_LOAD32-in-crc32c.patch \
20 file://static_library_as_option.patch \
21 file://0001-CMakeLists.txt-Make-the-test-discovery-occur-on-targ.patch \
22 file://run-ptest \
23 file://0001-Fix-build-error-with-gcc-13-by-adding-cstdint-header.patch \
24 file://0001-checkpoint.h-Add-missing-includes-cstdint.patch \
20 " 25 "
21 26
22SRC_URI:append:riscv32 = " file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch" 27SRC_URI:append:riscv32 = " file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch"
@@ -24,9 +29,8 @@ SRC_URI:append:mips = " file://0001-replace-old-sync-with-new-atomic-builtin-equ
24SRC_URI:append:powerpc = " file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch" 29SRC_URI:append:powerpc = " file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch"
25SRC_URI:remove:toolchain-clang:riscv32 = "file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch" 30SRC_URI:remove:toolchain-clang:riscv32 = "file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch"
26 31
27S = "${WORKDIR}/git"
28 32
29inherit cmake 33inherit cmake ptest
30 34
31PACKAGECONFIG ??= "bzip2 zlib lz4 gflags" 35PACKAGECONFIG ??= "bzip2 zlib lz4 gflags"
32PACKAGECONFIG[bzip2] = "-DWITH_BZ2=ON,-DWITH_BZ2=OFF,bzip2" 36PACKAGECONFIG[bzip2] = "-DWITH_BZ2=ON,-DWITH_BZ2=OFF,bzip2"
@@ -39,10 +43,11 @@ PACKAGECONFIG[gflags] = "-DWITH_GFLAGS=ON,-DWITH_GFLAGS=OFF,gflags"
39# Tools and tests currently don't compile on armv5 so we disable them 43# Tools and tests currently don't compile on armv5 so we disable them
40EXTRA_OECMAKE = "\ 44EXTRA_OECMAKE = "\
41 -DPORTABLE=ON \ 45 -DPORTABLE=ON \
42 -DWITH_TESTS=OFF \ 46 -DWITH_TESTS=${@bb.utils.contains("DISTRO_FEATURES", "ptest", "ON", "OFF", d)} \
43 -DWITH_BENCHMARK_TOOLS=OFF \ 47 -DWITH_BENCHMARK_TOOLS=OFF \
44 -DWITH_TOOLS=OFF \ 48 -DWITH_TOOLS=OFF \
45 -DFAIL_ON_WARNINGS=OFF \ 49 -DFAIL_ON_WARNINGS=OFF \
50 -DROCKSDB_BUILD_STATIC=OFF \
46" 51"
47 52
48CXXFLAGS += "${@bb.utils.contains('SELECTED_OPTIMIZATION', '-Og', '-DXXH_NO_INLINE_HINTS', '', d)}" 53CXXFLAGS += "${@bb.utils.contains('SELECTED_OPTIMIZATION', '-Og', '-DXXH_NO_INLINE_HINTS', '', d)}"
@@ -52,6 +57,21 @@ do_install:append() {
52 sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/cmake/rocksdb/RocksDBTargets.cmake 57 sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/cmake/rocksdb/RocksDBTargets.cmake
53} 58}
54 59
60do_install_ptest() {
61 install -d ${D}${PTEST_PATH}/tests
62 # only cover the basic test as all the tests need to take about 6 hours
63 # time ./run-ptest
64 # real 356m32.956s
65 # user 252m32.004s
66 # sys 178m50.246s
67 install -m 0755 ${B}/env_basic_test ${D}${PTEST_PATH}/tests/
68 install -m 0755 ${B}/db_basic_test ${D}${PTEST_PATH}/tests/
69 install -m 0755 ${B}/agg_merge_test ${D}${PTEST_PATH}/tests/
70 install -m 0755 ${B}/testutil_test ${D}${PTEST_PATH}/tests/
71 install -m 0755 ${B}/cache_test ${D}${PTEST_PATH}/tests/
72}
73
55# Need toku_time_now() implemented for ppc/musl 74# Need toku_time_now() implemented for ppc/musl
56# see utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h 75# see utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
57COMPATIBLE_HOST:libc-musl:powerpc = "null" 76COMPATIBLE_HOST:libc-musl:powerpc = "null"
77COMPATIBLE_HOST:armv5 = 'null'