aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-dbs/rocksdb/files
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-dbs/rocksdb/files')
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/0001-cmake-Add-check-for-atomic-support.patch15
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/0001-folly-Use-SYS_futex-for-syscall.patch42
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/0001-jemalloc_helper-Limit-the-mm_malloc.h-hack-to-glibc-.patch23
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/0001-range_tree-Implement-toku_time_now-for-rv32-rv64-in-.patch44
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch9
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/0002-cmake-Use-exported-target-for-bz2.patch (renamed from meta-oe/recipes-dbs/rocksdb/files/0001-cmake-Use-exported-target-for-bz2.patch)22
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/0003-cmake-Do-not-add-msse4.2-mpclmul-on-clang.patch33
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/0004-Implement-support-for-musl-ppc64.patch42
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/0005-Implement-timer-implementation-for-mips-platform.patch32
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/0006-Implement-timer-for-arm-v6.patch (renamed from meta-oe/recipes-dbs/rocksdb/files/arm.patch)18
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/0007-Fix-declaration-scope-of-LE_LOAD32-in-crc32c.patch39
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/mips.patch19
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/ppc64.patch28
13 files changed, 191 insertions, 175 deletions
diff --git a/meta-oe/recipes-dbs/rocksdb/files/0001-cmake-Add-check-for-atomic-support.patch b/meta-oe/recipes-dbs/rocksdb/files/0001-cmake-Add-check-for-atomic-support.patch
index 8bdd27ff25..ba6a2d4fbb 100644
--- a/meta-oe/recipes-dbs/rocksdb/files/0001-cmake-Add-check-for-atomic-support.patch
+++ b/meta-oe/recipes-dbs/rocksdb/files/0001-cmake-Add-check-for-atomic-support.patch
@@ -1,4 +1,4 @@
-From cf168ae0b7bceab8432d096719b331f18428fe39 Mon Sep 17 00:00:00 2001
+From 034a9c4ce2ae61cfcffa977f1eb8e6f68947f480 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
@@ -18,6 +18,7 @@ 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_fetch_add_8'
Upstream-Status: Submitted [https://github.com/facebook/rocksdb/pull/6555]
+
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
CMakeLists.txt | 5 +++
@@ -25,9 +26,11 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
2 files changed, 74 insertions(+)
create mode 100644 cmake/modules/CheckAtomic.cmake
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5cfc1b4803..0a7f820a22 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -935,7 +935,12 @@ endif()
+@@ -1038,7 +1038,12 @@ set(ROCKSDB_SHARED_LIB rocksdb-shared${ARTIFACT_SUFFIX})
if(WIN32)
set(SYSTEM_LIBS ${SYSTEM_LIBS} shlwapi.lib rpcrt4.lib)
else()
@@ -39,7 +42,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
+ endif()
endif()
- add_library(${ROCKSDB_STATIC_LIB} STATIC ${SOURCES} ${BUILD_VERSION_CC})
+ set(ROCKSDB_PLUGIN_EXTERNS "")
+diff --git a/cmake/modules/CheckAtomic.cmake b/cmake/modules/CheckAtomic.cmake
+new file mode 100644
+index 0000000000..8b7dc8a377
--- /dev/null
+++ b/cmake/modules/CheckAtomic.cmake
@@ -0,0 +1,69 @@
@@ -112,3 +118,6 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
+ endif()
+endif()
+
+--
+2.25.1
+
diff --git a/meta-oe/recipes-dbs/rocksdb/files/0001-folly-Use-SYS_futex-for-syscall.patch b/meta-oe/recipes-dbs/rocksdb/files/0001-folly-Use-SYS_futex-for-syscall.patch
deleted file mode 100644
index 9c70d4f6a6..0000000000
--- a/meta-oe/recipes-dbs/rocksdb/files/0001-folly-Use-SYS_futex-for-syscall.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From ddcc8a9f7e0f0bfee96f2f0a0c10f21f9fa9b05d Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 15 Nov 2020 15:02:28 -0800
-Subject: [PATCH] folly: Use SYS_futex for syscall
-
-glibc defines SYS_futex and on newer 32bit CPUs like RISCV-32, arc there
-is no 32bit time_t therefore define SYS_futex in terms of SYS_futex_time64
-
-Upstream-Status: Submitted [https://github.com/facebook/rocksdb/pull/7676]
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- third-party/folly/folly/detail/Futex.cpp | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
-
---- a/third-party/folly/folly/detail/Futex.cpp
-+++ b/third-party/folly/folly/detail/Futex.cpp
-@@ -48,9 +48,15 @@ namespace {
- #define FUTEX_CLOCK_REALTIME 256
- #endif
-
-+/// Newer 32bit CPUs eg. RISCV-32 are defaulting to 64bit time_t from get go and
-+/// therefore do not define __NR_futex
-+#if !defined(SYS_futex) && defined(SYS_futex_time64)
-+# define SYS_futex SYS_futex_time64
-+#endif
-+
- int nativeFutexWake(const void* addr, int count, uint32_t wakeMask) {
- long rv = syscall(
-- __NR_futex,
-+ SYS_futex,
- addr, /* addr1 */
- FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG, /* op */
- count, /* val */
-@@ -112,7 +118,7 @@ FutexResult nativeFutexWaitImpl(
- // Unlike FUTEX_WAIT, FUTEX_WAIT_BITSET requires an absolute timeout
- // value - http://locklessinc.com/articles/futex_cheat_sheet/
- long rv = syscall(
-- __NR_futex,
-+ SYS_futex,
- addr, /* addr1 */
- op, /* op */
- expected, /* val */
diff --git a/meta-oe/recipes-dbs/rocksdb/files/0001-jemalloc_helper-Limit-the-mm_malloc.h-hack-to-glibc-.patch b/meta-oe/recipes-dbs/rocksdb/files/0001-jemalloc_helper-Limit-the-mm_malloc.h-hack-to-glibc-.patch
deleted file mode 100644
index dbb0dda221..0000000000
--- a/meta-oe/recipes-dbs/rocksdb/files/0001-jemalloc_helper-Limit-the-mm_malloc.h-hack-to-glibc-.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From 1a69d4cc3f97e348dba9714c7ec60da1a8650664 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Tue, 15 Jun 2021 22:05:36 -0700
-Subject: [PATCH] jemalloc_helper: Limit the mm_malloc.h hack to glibc on linux
-
-Musl does not need this hack
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- port/jemalloc_helper.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/port/jemalloc_helper.h
-+++ b/port/jemalloc_helper.h
-@@ -5,7 +5,7 @@
-
- #pragma once
-
--#if defined(__clang__)
-+#if defined(__clang__) && defined(__GLIBC__)
- // glibc's `posix_memalign()` declaration specifies `throw()` while clang's
- // declaration does not. There is a hack in clang to make its re-declaration
- // compatible with glibc's if they are declared consecutively. That hack breaks
diff --git a/meta-oe/recipes-dbs/rocksdb/files/0001-range_tree-Implement-toku_time_now-for-rv32-rv64-in-.patch b/meta-oe/recipes-dbs/rocksdb/files/0001-range_tree-Implement-toku_time_now-for-rv32-rv64-in-.patch
deleted file mode 100644
index 86c1bffea6..0000000000
--- a/meta-oe/recipes-dbs/rocksdb/files/0001-range_tree-Implement-toku_time_now-for-rv32-rv64-in-.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 89c032a9b4011385c0b504ea61e5df0db71f0ff5 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 16 Jun 2021 19:06:02 -0700
-Subject: [PATCH] range_tree: Implement toku_time_now for rv32/rv64 in asm
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- .../range_tree/lib/portability/toku_time.h | 19 +++++++++++++++++++
- 1 file changed, 19 insertions(+)
-
-diff --git a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
-index 4425a4a2e..4ac964f85 100644
---- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
-+++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
-@@ -133,6 +133,25 @@ static inline tokutime_t toku_time_now(void) {
- return result;
- #elif defined(__powerpc__)
- return __ppc_get_timebase();
-+#elif defined(__riscv) // RISC-V
-+#if __riscv_xlen == 32
-+ uint32_t lo, hi0, hi1;
-+ __asm __volatile__(
-+ "rdcycleh %0\n"
-+ "rdcycle %1\n"
-+ "rdcycleh %2\n"
-+ "sub %0, %0, %2\n"
-+ "seqz %0, %0\n"
-+ "sub %0, zero, %0\n"
-+ "and %1, %1, %0\n"
-+ : "=r"(hi0), "=r"(lo), "=r"(hi1));
-+ return ((uint64_t)hi1 << 32) | lo;
-+#else
-+ uint64_t result;
-+ __asm __volatile__("rdcycle %0" : "=r"(result));
-+ return result;
-+#endif
-+
- #else
- #error No timer implementation for this platform
- #endif
---
-2.32.0
-
diff --git a/meta-oe/recipes-dbs/rocksdb/files/0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch b/meta-oe/recipes-dbs/rocksdb/files/0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch
index 4aa91d9b26..342964cf2c 100644
--- a/meta-oe/recipes-dbs/rocksdb/files/0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch
+++ b/meta-oe/recipes-dbs/rocksdb/files/0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch
@@ -1,4 +1,4 @@
-From 114c42fba3fc86119710e8dd1bb2b7a9e39e3064 Mon Sep 17 00:00:00 2001
+From 1ba84e1b8d4c9a3ad85dc443b0df4d79c89cca4b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 17 Jun 2021 19:35:01 -0700
Subject: [PATCH] replace old sync with new atomic builtin equivalents
@@ -6,11 +6,15 @@ Subject: [PATCH] replace old sync with new atomic builtin equivalents
Helps compiling with gcc on newer arches e.g. riscv32 where these
__sync* builtins are not implemented atleast for 64bit values
+Upstream-Status: Pending
+
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
.../range/range_tree/lib/portability/toku_atomic.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
+diff --git a/utilities/transactions/lock/range/range_tree/lib/portability/toku_atomic.h b/utilities/transactions/lock/range/range_tree/lib/portability/toku_atomic.h
+index aaa2298faf..9385902808 100644
--- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_atomic.h
+++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_atomic.h
@@ -77,37 +77,37 @@ template <typename T, typename U>
@@ -57,3 +61,6 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
}
// in case you include this but not toku_portability.h
+--
+2.25.1
+
diff --git a/meta-oe/recipes-dbs/rocksdb/files/0001-cmake-Use-exported-target-for-bz2.patch b/meta-oe/recipes-dbs/rocksdb/files/0002-cmake-Use-exported-target-for-bz2.patch
index d3054759a7..6b46a1f300 100644
--- a/meta-oe/recipes-dbs/rocksdb/files/0001-cmake-Use-exported-target-for-bz2.patch
+++ b/meta-oe/recipes-dbs/rocksdb/files/0002-cmake-Use-exported-target-for-bz2.patch
@@ -1,4 +1,4 @@
-From 46a4e585175cac8d76bd0b64f0fc27c9e22f04a1 Mon Sep 17 00:00:00 2001
+From bb3fc86f87a9acc64628e1cb32f5c8a1cfbeb880 Mon Sep 17 00:00:00 2001
From: Pascal Bach <pascal.bach@nextrem.ch>
Date: Mon, 12 Oct 2020 21:22:46 +0200
Subject: [PATCH] cmake: Use exported target for bz2
@@ -8,21 +8,14 @@ This is not portable and makes it fail in environment like Yocto.
Upstream-Status: Submitted [https://github.com/facebook/rocksdb/pull/7541]
---
- CMakeLists.txt | 9 ++-------
- 1 file changed, 2 insertions(+), 7 deletions(-)
+ CMakeLists.txt | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0a7f820a22..be80edb955 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -32,7 +32,7 @@
- # 3. cmake ..
- # 4. make -j
-
--cmake_minimum_required(VERSION 3.5.1)
-+cmake_minimum_required(VERSION 3.7.2)
-
- list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules/")
- include(ReadVersion)
-@@ -152,12 +152,7 @@ else()
+@@ -149,12 +149,7 @@ else()
if(WITH_BZ2)
find_package(BZip2 REQUIRED)
add_definitions(-DBZIP2)
@@ -36,3 +29,6 @@ Upstream-Status: Submitted [https://github.com/facebook/rocksdb/pull/7541]
endif()
if(WITH_LZ4)
+--
+2.25.1
+
diff --git a/meta-oe/recipes-dbs/rocksdb/files/0003-cmake-Do-not-add-msse4.2-mpclmul-on-clang.patch b/meta-oe/recipes-dbs/rocksdb/files/0003-cmake-Do-not-add-msse4.2-mpclmul-on-clang.patch
new file mode 100644
index 0000000000..e2f785d7cf
--- /dev/null
+++ b/meta-oe/recipes-dbs/rocksdb/files/0003-cmake-Do-not-add-msse4.2-mpclmul-on-clang.patch
@@ -0,0 +1,33 @@
+From bb10f55eb77be7b7eee94cb3506c9cbef8e24099 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 26 Jan 2023 13:00:43 -0800
+Subject: [PATCH] cmake: Do not add -msse4.2 -mpclmul on clang
+
+When testcase is compiled with clang and -msse4.2 -mpclmul is added to
+cxxflags then clang -m32 still ends up compiling the test case which is
+not correct for i386, therefore depend on yocto to pass the right flags
+from environemnt via cflags rather than manufecture them here
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index be80edb955..a1bbade81a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -279,7 +279,7 @@ endif()
+
+ include(CheckCXXSourceCompiles)
+ set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+-if(NOT MSVC)
++if(NOT MSVC AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ set(CMAKE_REQUIRED_FLAGS "-msse4.2 -mpclmul")
+ endif()
+
+--
+2.25.1
+
diff --git a/meta-oe/recipes-dbs/rocksdb/files/0004-Implement-support-for-musl-ppc64.patch b/meta-oe/recipes-dbs/rocksdb/files/0004-Implement-support-for-musl-ppc64.patch
new file mode 100644
index 0000000000..5fcf1f7dae
--- /dev/null
+++ b/meta-oe/recipes-dbs/rocksdb/files/0004-Implement-support-for-musl-ppc64.patch
@@ -0,0 +1,42 @@
+From c6accd34e8169d7a6b92fc89dce5d4309978e39e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 21 Mar 2024 14:11:09 +0800
+Subject: [PATCH] Implement support for musl/ppc64
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ .../lock/range/range_tree/lib/portability/toku_time.h | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
+index 9b83c53511..0a7488c397 100644
+--- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
++++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
+@@ -58,7 +58,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
+ #include <stdint.h>
+ #include <sys/time.h>
+ #include <time.h>
+-#if defined(__powerpc__)
++#if defined(__powerpc__) && defined(__GLIBC__)
+ #include <sys/platform/ppc.h>
+ #endif
+
+@@ -131,8 +131,12 @@ static inline tokutime_t toku_time_now(void) {
+ uint64_t result;
+ __asm __volatile__("mrs %[rt], cntvct_el0" : [rt] "=r"(result));
+ return result;
+-#elif defined(__powerpc__)
++#elif defined(__powerpc__) && defined(__GLIBC__)
+ return __ppc_get_timebase();
++#elif defined(__powerpc64__) || defined(__ppc64__)
++ uint64_t result;
++ asm volatile("mfspr %0, 268" : "=r"(result));
++ return result;
+ #elif defined(__s390x__)
+ uint64_t result;
+ asm volatile("stckf %0" : "=Q"(result) : : "cc");
+--
+2.25.1
+
diff --git a/meta-oe/recipes-dbs/rocksdb/files/0005-Implement-timer-implementation-for-mips-platform.patch b/meta-oe/recipes-dbs/rocksdb/files/0005-Implement-timer-implementation-for-mips-platform.patch
new file mode 100644
index 0000000000..2979b73d2f
--- /dev/null
+++ b/meta-oe/recipes-dbs/rocksdb/files/0005-Implement-timer-implementation-for-mips-platform.patch
@@ -0,0 +1,32 @@
+From 2ebc0ff33e41d23e4d3aec1a86f3d8bd4be410e7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 21 Mar 2024 14:14:58 +0800
+Subject: [PATCH] Implement timer implementation for mips platform
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ .../lock/range/range_tree/lib/portability/toku_time.h | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
+index 0a7488c397..ad7d9f2124 100644
+--- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
++++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
+@@ -162,6 +162,12 @@ static inline tokutime_t toku_time_now(void) {
+ unsigned long result;
+ asm volatile ("rdtime.d\t%0,$r0" : "=r" (result));
+ return result;
++#elif defined(__mips__)
++ // mips apparently only allows rdtsc for superusers, so we fall
++ // back to gettimeofday. It's possible clock_gettime would be better.
++ struct timeval tv;
++ gettimeofday(&tv, nullptr);
++ return (uint64_t)tv.tv_sec * 1000000 + tv.tv_usec;
+ #else
+ #error No timer implementation for this platform
+ #endif
+--
+2.25.1
+
diff --git a/meta-oe/recipes-dbs/rocksdb/files/arm.patch b/meta-oe/recipes-dbs/rocksdb/files/0006-Implement-timer-for-arm-v6.patch
index d428a6624a..0ae673c425 100644
--- a/meta-oe/recipes-dbs/rocksdb/files/arm.patch
+++ b/meta-oe/recipes-dbs/rocksdb/files/0006-Implement-timer-for-arm-v6.patch
@@ -1,9 +1,20 @@
-implement timer for arm >= v6
+From 9e274ba2762724f353227b5a3a6e4433f706468a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 21 Mar 2024 14:16:08 +0800
+Subject: [PATCH] Implement timer for arm >= v6
+
+Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ .../range/range_tree/lib/portability/toku_time.h | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
+index ad7d9f2124..bcb795b7e7 100644
--- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
+++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
-@@ -161,6 +161,20 @@ static inline tokutime_t toku_time_now(v
+@@ -168,6 +168,20 @@ static inline tokutime_t toku_time_now(void) {
struct timeval tv;
gettimeofday(&tv, nullptr);
return (uint64_t)tv.tv_sec * 1000000 + tv.tv_usec;
@@ -24,3 +35,6 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
#else
#error No timer implementation for this platform
#endif
+--
+2.25.1
+
diff --git a/meta-oe/recipes-dbs/rocksdb/files/0007-Fix-declaration-scope-of-LE_LOAD32-in-crc32c.patch b/meta-oe/recipes-dbs/rocksdb/files/0007-Fix-declaration-scope-of-LE_LOAD32-in-crc32c.patch
new file mode 100644
index 0000000000..9ba34450ba
--- /dev/null
+++ b/meta-oe/recipes-dbs/rocksdb/files/0007-Fix-declaration-scope-of-LE_LOAD32-in-crc32c.patch
@@ -0,0 +1,39 @@
+From ed549d43c8b691cd7891c7e5c76df189feb04b4f Mon Sep 17 00:00:00 2001
+From: Yi Zhao <yi.zhao@windriver.com>
+Date: Sun, 7 Apr 2024 17:16:53 +0800
+Subject: [PATCH] Fix declaration scope of LE_LOAD32 in crc32c
+
+Fix build error when __SSE4_2__ is defined:
+util/crc32c.cc: In function 'void rocksdb::crc32c::DefaultCRC32(uint64_t*, const uint8_t**)':
+util/crc32c.cc:267:53: error: 'LE_LOAD32' was not declared in this scope
+ 267 | *l = _mm_crc32_u32(static_cast<unsigned int>(*l), LE_LOAD32(*p));
+ | ^~~~~~~~~
+
+Upstream-Status: Submitted [https://github.com/facebook/rocksdb/pull/12515]
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ util/crc32c.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util/crc32c.cc b/util/crc32c.cc
+index 38a69bb50..aa13ad882 100644
+--- a/util/crc32c.cc
++++ b/util/crc32c.cc
+@@ -242,12 +242,12 @@ static const uint32_t table3_[256] = {
+ 0xc747336e, 0x1a0299d6, 0x782010ef, 0xa565ba57, 0xbc65029d, 0x6120a825,
+ 0x0302211c, 0xde478ba4, 0x31035088, 0xec46fa30, 0x8e647309, 0x5321d9b1,
+ 0x4a21617b, 0x9764cbc3, 0xf54642fa, 0x2803e842};
++#endif // !__SSE4_2__
+
+ // Used to fetch a naturally-aligned 32-bit word in little endian byte-order
+ static inline uint32_t LE_LOAD32(const uint8_t* p) {
+ return DecodeFixed32(reinterpret_cast<const char*>(p));
+ }
+-#endif // !__SSE4_2__
+
+ static inline void DefaultCRC32(uint64_t* l, uint8_t const** p) {
+ #ifndef __SSE4_2__
+--
+2.25.1
+
diff --git a/meta-oe/recipes-dbs/rocksdb/files/mips.patch b/meta-oe/recipes-dbs/rocksdb/files/mips.patch
deleted file mode 100644
index db2305d296..0000000000
--- a/meta-oe/recipes-dbs/rocksdb/files/mips.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-implement timer implementation for mips platform
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
---- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
-+++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
-@@ -155,7 +155,12 @@ static inline tokutime_t toku_time_now(v
- __asm __volatile__("rdcycle %0" : "=r"(result));
- return result;
- #endif
--
-+#elif defined(__mips__)
-+ // mips apparently only allows rdtsc for superusers, so we fall
-+ // back to gettimeofday. It's possible clock_gettime would be better.
-+ struct timeval tv;
-+ gettimeofday(&tv, nullptr);
-+ return (uint64_t)tv.tv_sec * 1000000 + tv.tv_usec;
- #else
- #error No timer implementation for this platform
- #endif
diff --git a/meta-oe/recipes-dbs/rocksdb/files/ppc64.patch b/meta-oe/recipes-dbs/rocksdb/files/ppc64.patch
deleted file mode 100644
index bc40f1b1e7..0000000000
--- a/meta-oe/recipes-dbs/rocksdb/files/ppc64.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-implement support for musl/ppc64
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
---- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
-+++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
-@@ -58,7 +58,7 @@ Copyright (c) 2006, 2015, Percona and/or
- #include <stdint.h>
- #include <sys/time.h>
- #include <time.h>
--#if defined(__powerpc__)
-+#if defined(__powerpc__) && defined(__GLIBC__)
- #include <sys/platform/ppc.h>
- #endif
-
-@@ -131,8 +131,12 @@ static inline tokutime_t toku_time_now(v
- uint64_t result;
- __asm __volatile__("mrs %[rt], cntvct_el0" : [ rt ] "=r"(result));
- return result;
--#elif defined(__powerpc__)
-+#elif defined(__powerpc__) && defined(__GLIBC__)
- return __ppc_get_timebase();
-+#elif defined(__powerpc64__) || defined(__ppc64__)
-+ uint64_t result;
-+ asm volatile("mfspr %0, 268" : "=r"(result));
-+ return result;
- #elif defined(__riscv) // RISC-V
- #if __riscv_xlen == 32
- uint32_t lo, hi0, hi1;