aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo-Chuan Hsieh <sunpoet@FreeBSD.org>2021-10-25 15:05:26 +0000
committerPo-Chuan Hsieh <sunpoet@FreeBSD.org>2021-10-25 15:57:13 +0000
commitf9c44858605e6cc3af07fb61006dfd7a86d694f9 (patch)
tree34970e9ffae6920e0914f54d4917617ac295f491
parenta9cf0e37818b0a3a9ff565fa8e7b40bb4dc9c8e1 (diff)
downloadports-f9c44858605e6cc3af07fb61006dfd7a86d694f9.tar.gz
ports-f9c44858605e6cc3af07fb61006dfd7a86d694f9.zip
databases/rocksdb: Move architecture-specific fixes into single patch file
- patch-aarch64 is merged from: - patch-CMakeLists.txt - patch-build_tools-build_detect_platform (part of) - patch-powerpc64 is merged from: - patch-util_crc32c.cc - patch-utilities_transactions_lock_range_range__tree_lib_portability_toku__time.h
-rw-r--r--databases/rocksdb/files/patch-CMakeLists.txt14
-rw-r--r--databases/rocksdb/files/patch-aarch6427
-rw-r--r--databases/rocksdb/files/patch-build_tools-build_detect_platform11
-rw-r--r--databases/rocksdb/files/patch-powerpc64 (renamed from databases/rocksdb/files/patch-utilities_transactions_lock_range_range__tree_lib_portability_toku__time.h)24
-rw-r--r--databases/rocksdb/files/patch-util_crc32c.cc24
5 files changed, 51 insertions, 49 deletions
diff --git a/databases/rocksdb/files/patch-CMakeLists.txt b/databases/rocksdb/files/patch-CMakeLists.txt
deleted file mode 100644
index 31790f595624..000000000000
--- a/databases/rocksdb/files/patch-CMakeLists.txt
+++ /dev/null
@@ -1,14 +0,0 @@
---- CMakeLists.txt.orig 2021-06-25 21:15:04 UTC
-+++ CMakeLists.txt
-@@ -612,6 +612,11 @@ if(HAVE_AUXV_GETAUXVAL)
- add_definitions(-DROCKSDB_AUXV_GETAUXVAL_PRESENT)
- endif()
-
-+check_cxx_symbol_exists(elf_aux_info sys/auxv.h HAVE_ELF_AUX_INFO)
-+if(HAVE_ELF_AUX_INFO)
-+ add_definitions(-DROCKSDB_AUXV_GETAUXVAL_PRESENT)
-+endif()
-+
- include_directories(${PROJECT_SOURCE_DIR})
- include_directories(${PROJECT_SOURCE_DIR}/include)
- if(WITH_FOLLY_DISTRIBUTED_MUTEX)
diff --git a/databases/rocksdb/files/patch-aarch64 b/databases/rocksdb/files/patch-aarch64
new file mode 100644
index 000000000000..5eeecf75c7df
--- /dev/null
+++ b/databases/rocksdb/files/patch-aarch64
@@ -0,0 +1,27 @@
+--- CMakeLists.txt.orig 2021-06-25 21:15:04 UTC
++++ CMakeLists.txt
+@@ -612,6 +612,11 @@ if(HAVE_AUXV_GETAUXVAL)
+ add_definitions(-DROCKSDB_AUXV_GETAUXVAL_PRESENT)
+ endif()
+
++check_cxx_symbol_exists(elf_aux_info sys/auxv.h HAVE_ELF_AUX_INFO)
++if(HAVE_ELF_AUX_INFO)
++ add_definitions(-DROCKSDB_AUXV_GETAUXVAL_PRESENT)
++endif()
++
+ include_directories(${PROJECT_SOURCE_DIR})
+ include_directories(${PROJECT_SOURCE_DIR}/include)
+ if(WITH_FOLLY_DISTRIBUTED_MUTEX)
+--- build_tools/build_detect_platform.orig 2021-06-25 21:15:04 UTC
++++ build_tools/build_detect_platform
+@@ -599,8 +599,8 @@ EOF
+ fi
+
+ # TODO(tec): Fix -Wshorten-64-to-32 errors on FreeBSD and enable the warning.
+-# -Wshorten-64-to-32 breaks compilation on FreeBSD i386
+-if ! [ "$TARGET_OS" = FreeBSD -a "$TARGET_ARCHITECTURE" = i386 ]; then
++# -Wshorten-64-to-32 breaks compilation on FreeBSD i386 and aarch64
++if ! { [ "$TARGET_OS" = FreeBSD ] && [ "$TARGET_ARCHITECTURE" = i386 -o "$TARGET_ARCHITECTURE" = "arm64" ]; }; then
+ # Test whether -Wshorten-64-to-32 is available
+ $CXX $PLATFORM_CXXFLAGS -x c++ - -o /dev/null -Wshorten-64-to-32 2>/dev/null <<EOF
+ int main() {}
diff --git a/databases/rocksdb/files/patch-build_tools-build_detect_platform b/databases/rocksdb/files/patch-build_tools-build_detect_platform
index 0eae538be82a..b6b5906c5c83 100644
--- a/databases/rocksdb/files/patch-build_tools-build_detect_platform
+++ b/databases/rocksdb/files/patch-build_tools-build_detect_platform
@@ -111,14 +111,3 @@ Remove -fno-builtin-memcmp and -ltcmalloc
fi
fi
-@@ -599,8 +599,8 @@ EOF
- fi
-
- # TODO(tec): Fix -Wshorten-64-to-32 errors on FreeBSD and enable the warning.
--# -Wshorten-64-to-32 breaks compilation on FreeBSD i386
--if ! [ "$TARGET_OS" = FreeBSD -a "$TARGET_ARCHITECTURE" = i386 ]; then
-+# -Wshorten-64-to-32 breaks compilation on FreeBSD i386 and aarch64
-+if ! { [ "$TARGET_OS" = FreeBSD ] && [ "$TARGET_ARCHITECTURE" = i386 -o "$TARGET_ARCHITECTURE" = "arm64" ]; }; then
- # Test whether -Wshorten-64-to-32 is available
- $CXX $PLATFORM_CXXFLAGS -x c++ - -o /dev/null -Wshorten-64-to-32 2>/dev/null <<EOF
- int main() {}
diff --git a/databases/rocksdb/files/patch-utilities_transactions_lock_range_range__tree_lib_portability_toku__time.h b/databases/rocksdb/files/patch-powerpc64
index 340655a5e94d..16673cc4ae42 100644
--- a/databases/rocksdb/files/patch-utilities_transactions_lock_range_range__tree_lib_portability_toku__time.h
+++ b/databases/rocksdb/files/patch-powerpc64
@@ -1,3 +1,27 @@
+--- util/crc32c.cc.orig 2021-06-25 21:15:04 UTC
++++ util/crc32c.cc
+@@ -488,6 +488,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() {
--- utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h.orig 2021-10-17 17:02:20 UTC
+++ utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
@@ -58,7 +58,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliate
diff --git a/databases/rocksdb/files/patch-util_crc32c.cc b/databases/rocksdb/files/patch-util_crc32c.cc
deleted file mode 100644
index 7325d476b4b2..000000000000
--- a/databases/rocksdb/files/patch-util_crc32c.cc
+++ /dev/null
@@ -1,24 +0,0 @@
---- util/crc32c.cc.orig 2021-06-25 21:15:04 UTC
-+++ util/crc32c.cc
-@@ -488,6 +488,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() {