All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] rocksdb: Fix build with ppc64/musl
@ 2021-06-17  6:18 Khem Raj
  0 siblings, 0 replies; only message in thread
From: Khem Raj @ 2021-06-17  6:18 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta-oe/recipes-dbs/rocksdb/files/ppc64.patch | 28 +++++++++++++++++++
 meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb |  1 +
 2 files changed, 29 insertions(+)
 create mode 100644 meta-oe/recipes-dbs/rocksdb/files/ppc64.patch

diff --git a/meta-oe/recipes-dbs/rocksdb/files/ppc64.patch b/meta-oe/recipes-dbs/rocksdb/files/ppc64.patch
new file mode 100644
index 0000000000..bc40f1b1e7
--- /dev/null
+++ b/meta-oe/recipes-dbs/rocksdb/files/ppc64.patch
@@ -0,0 +1,28 @@
+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;
diff --git a/meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb b/meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb
index 98930c6e6d..d03d0c9529 100644
--- a/meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb
+++ b/meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb
@@ -15,6 +15,7 @@ SRC_URI = "git://github.com/facebook/${BPN}.git;branch=${SRCBRANCH} \
            file://0001-folly-Use-SYS_futex-for-syscall.patch \
            file://0001-jemalloc_helper-Limit-the-mm_malloc.h-hack-to-glibc-.patch \
            file://0001-range_tree-Implement-toku_time_now-for-rv32-rv64-in-.patch \
+           file://ppc64.patch \
           "
 
 S = "${WORKDIR}/git"
-- 
2.32.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-17  6:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17  6:18 [meta-oe][PATCH] rocksdb: Fix build with ppc64/musl Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.