aboutsummaryrefslogtreecommitdiff
path: root/databases/rocksdb
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2020-12-02 00:52:50 +0000
committerPiotr Kubaj <pkubaj@FreeBSD.org>2020-12-02 00:52:50 +0000
commit3e512a1df4a0561fb502cbe56282230817dcac02 (patch)
tree46b818c32ef052a7d817f05a6d38b74ee275ba44 /databases/rocksdb
parent5a6cd205a089e5b6a788029152f7fe588ed8e0d0 (diff)
downloadports-3e512a1df4a0561fb502cbe56282230817dcac02.tar.gz
ports-3e512a1df4a0561fb502cbe56282230817dcac02.zip
databases/rocksdb: fix build on powerpc64*
Merge upstream commit that fixes build with LLVM on ppc64* (also affects other systems) and add patch which fixes build specifically on FreeBSD (PR currently waiting for acceptance).
Notes
Notes: svn path=/head/; revision=556800
Diffstat (limited to 'databases/rocksdb')
-rw-r--r--databases/rocksdb/Makefile6
-rw-r--r--databases/rocksdb/distinfo4
-rw-r--r--databases/rocksdb/files/patch-util_crc32c.cc24
3 files changed, 32 insertions, 2 deletions
diff --git a/databases/rocksdb/Makefile b/databases/rocksdb/Makefile
index f4b3ac08bc9e..bb40ea613ab0 100644
--- a/databases/rocksdb/Makefile
+++ b/databases/rocksdb/Makefile
@@ -6,6 +6,9 @@ PORTVERSION= 6.11.6
DISTVERSIONPREFIX= v
CATEGORIES= databases
+PATCH_SITES= https://github.com/facebook/${PORTNAME}/commit/
+PATCHFILES= b937be377901afa32357b60eebbee80f14087180.patch:-p1
+
MAINTAINER?= sunpoet@FreeBSD.org
COMMENT?= Persistent key-value store for fast storage environments
@@ -17,7 +20,8 @@ LICENSE_FILE_GPLv2= ${WRKSRC}/COPYING
BROKEN_DragonFly= does not build on DragonFly BSD using GCC with -Werror
BROKEN_armv6?= does not build: db/c.cc:2281:44: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'size_t' (aka 'unsigned int')
BROKEN_armv7?= does not build: /nxb-bin/usr/bin/ld: undefined reference to symbol `__gnu_Unwind_Find_exidx@@FBSD_1.4' (try adding -lc) #'`
-BROKEN_powerpc64= does not build: util/crc32c.cc:435:22: 'arch_ppc_probe' was not declared in this scope
+BROKEN_FreeBSD_11_powerpc64= does not build: util/crc32c.cc:435:22: 'arch_ppc_probe' was not declared in this scope
+BROKEN_FreeBSD_12_powerpc64= does not build: util/crc32c.cc:435:22: 'arch_ppc_probe' was not declared in this scope
BUILD_DEPENDS= bash:shells/bash
LIB_DEPENDS= libgflags.so:devel/gflags \
diff --git a/databases/rocksdb/distinfo b/databases/rocksdb/distinfo
index cbb7656a75a9..fc5f73414123 100644
--- a/databases/rocksdb/distinfo
+++ b/databases/rocksdb/distinfo
@@ -1,3 +1,5 @@
-TIMESTAMP = 1602780722
+TIMESTAMP = 1606857109
SHA256 (facebook-rocksdb-v6.11.6_GH0.tar.gz) = 7ff7cb277cad1dc4d1516c61470816e21c7c6e4dbb9a6e517dd590f2f2732b56
SIZE (facebook-rocksdb-v6.11.6_GH0.tar.gz) = 6210689
+SHA256 (b937be377901afa32357b60eebbee80f14087180.patch) = 05ec8d1d8710e954f43f528de012feb26ca3f1a46e77994b9591882ce2d64060
+SIZE (b937be377901afa32357b60eebbee80f14087180.patch) = 12681
diff --git a/databases/rocksdb/files/patch-util_crc32c.cc b/databases/rocksdb/files/patch-util_crc32c.cc
new file mode 100644
index 000000000000..71f38e5898ca
--- /dev/null
+++ b/databases/rocksdb/files/patch-util_crc32c.cc
@@ -0,0 +1,24 @@
+--- util/crc32c.cc.orig 2020-12-01 23:49:39 UTC
++++ util/crc32c.cc
+@@ -463,6 +463,21 @@ static int arch_ppc_probe(void) {
+
+ return arch_ppc_crc32;
+ }
++#elif __FreeBSD__
++#include <machine/cpu.h>
++#include <sys/auxv.h>
++#include <sys/elf_common.h>
++static int arch_ppc_probe(void) {
++ unsigned long cpufeatures;
++ arch_ppc_crc32 = 0;
++
++#if defined(__powerpc64__)
++ elf_aux_info(AT_HWCAP2, &cpufeatures, sizeof(cpufeatures));
++ if (cpufeatures & PPC_FEATURE2_HAS_VEC_CRYPTO) arch_ppc_crc32 = 1;
++#endif /* __powerpc64__ */
++
++ return arch_ppc_crc32;
++}
+ #endif // __linux__
+
+ static bool isAltiVec() {