aboutsummaryrefslogtreecommitdiff
path: root/databases/clickhouse/files
diff options
context:
space:
mode:
authorKirill Ponomarev <krion@FreeBSD.org>2022-01-17 07:33:17 +0000
committerKirill Ponomarev <krion@FreeBSD.org>2022-01-17 07:35:13 +0000
commitedb56d4c62ae865be24e1fb81c7657d42a27c355 (patch)
tree1f84e5b960edfc857dce27a9d27a56ff6b3f595d /databases/clickhouse/files
parentffab526e3cf40420663ec62457556521d41f4ed5 (diff)
downloadports-edb56d4c62ae865be24e1fb81c7657d42a27c355.tar.gz
ports-edb56d4c62ae865be24e1fb81c7657d42a27c355.zip
databases/clickhouse: Update to 21.12.3.32
Diffstat (limited to 'databases/clickhouse/files')
-rw-r--r--databases/clickhouse/files/clickhouse.in11
-rw-r--r--databases/clickhouse/files/patch-cmake_find_krb5.cmake11
-rw-r--r--databases/clickhouse/files/patch-cmake_find_ldap.cmake10
-rw-r--r--databases/clickhouse/files/patch-cmake_freebsd_default__libs.cmake2
-rw-r--r--databases/clickhouse/files/patch-cmake_freebsd_toolchain-x86__64.cmake14
-rw-r--r--databases/clickhouse/files/patch-cmake_tools.cmake11
-rw-r--r--databases/clickhouse/files/patch-contrib_abseil-cpp_absl_copts_AbseilConfigureCopts.cmake13
-rw-r--r--databases/clickhouse/files/patch-contrib_cassandra_CMakeLists.txt5
-rw-r--r--databases/clickhouse/files/patch-contrib_grpc_third__party_cares_cares_CMakeLists.txt15
-rw-r--r--databases/clickhouse/files/patch-contrib_jemalloc-cmake_CMakeLists.txt13
-rw-r--r--databases/clickhouse/files/patch-contrib_jemalloc-cmake_include__freebsd__aarch64_jemalloc_internal_jemalloc__internal__defs.h.in11
-rw-r--r--databases/clickhouse/files/patch-contrib_krb5-cmake_autoconf__freebsd.h767
-rw-r--r--databases/clickhouse/files/patch-contrib_rocksdb_util_crc32c.cc38
-rw-r--r--databases/clickhouse/files/patch-contrib_rocksdb_util_crc32c__arm64.cc45
-rw-r--r--databases/clickhouse/files/patch-src_Common_MemoryStatisticsOS.cpp31
-rw-r--r--databases/clickhouse/files/patch-src_Common_StackTrace.cpp11
-rw-r--r--databases/clickhouse/files/patch-src_Interpreters_AsynchronousMetrics.cpp11
-rw-r--r--databases/clickhouse/files/patch-src_Interpreters_AsynchronousMetrics.h11
18 files changed, 869 insertions, 161 deletions
diff --git a/databases/clickhouse/files/clickhouse.in b/databases/clickhouse/files/clickhouse.in
index f058335c875d..a3ff2098e49b 100644
--- a/databases/clickhouse/files/clickhouse.in
+++ b/databases/clickhouse/files/clickhouse.in
@@ -8,6 +8,9 @@
#
# clickhouse_enable (bool): Set to "NO" by default
# Set it to "YES" to enable clickhouse server
+%%LEGACY_LIMITS%%# clickhouse_limits (bool): Set to "NO" by default.
+%%LEGACY_LIMITS%%# Set it to yes to run `limits -e -U clickhouse`
+%%LEGACY_LIMITS%%# just before clickhouse starts.
# clickhouse_config (str): Path to config file (required).
# (default: %%PREFIX%%/etc/clickhouse-server/config.xml)
# clickhouse_rundir (str): Path to directory holding a pidfile.
@@ -29,6 +32,7 @@ rcvar=clickhouse_enable
load_rc_config ${name}
: ${clickhouse_enable="NO"}
+%%LEGACY_LIMITS%%: ${clickhouse_limits="NO"}
: ${clickhouse_config="%%PREFIX%%/etc/clickhouse-server/config.xml"}
: ${clickhouse_rundir="/var/run/clickhouse"}
: ${clickhouse_user="clickhouse"}
@@ -50,7 +54,12 @@ clickhouse_prestart () {
install -d -o ${clickhouse_user} -g ${clickhouse_group} ${_dir}
done
- return 0
+%%LEGACY_LIMITS%% if checkyesno clickhouse_limits; then
+%%LEGACY_LIMITS%% eval `/usr/bin/limits -e -U ${clickhouse_user}` 2>/dev/null
+%%LEGACY_LIMITS%% else
+%%LEGACY_LIMITS%% return 0
+%%LEGACY_LIMITS%% fi
+%%MODERN_LIMITS%% return 0
}
run_rc_command "$1"
diff --git a/databases/clickhouse/files/patch-cmake_find_krb5.cmake b/databases/clickhouse/files/patch-cmake_find_krb5.cmake
new file mode 100644
index 000000000000..ad14f69f0b77
--- /dev/null
+++ b/databases/clickhouse/files/patch-cmake_find_krb5.cmake
@@ -0,0 +1,11 @@
+--- cmake/find/krb5.cmake.orig 2021-12-26 09:29:33 UTC
++++ cmake/find/krb5.cmake
+@@ -5,7 +5,7 @@ if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/krb5/
+ set (ENABLE_KRB5 0)
+ endif ()
+
+-if (NOT CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT (CMAKE_SYSTEM_NAME MATCHES "Darwin" AND NOT CMAKE_CROSSCOMPILING))
++if (NOT CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD" AND NOT (CMAKE_SYSTEM_NAME MATCHES "Darwin" AND NOT CMAKE_CROSSCOMPILING))
+ message (WARNING "krb5 disabled in non-Linux and non-native-Darwin environments")
+ set (ENABLE_KRB5 0)
+ endif ()
diff --git a/databases/clickhouse/files/patch-cmake_find_ldap.cmake b/databases/clickhouse/files/patch-cmake_find_ldap.cmake
deleted file mode 100644
index 4ccad4821cf7..000000000000
--- a/databases/clickhouse/files/patch-cmake_find_ldap.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
---- cmake/find/ldap.cmake.orig 2021-09-13 15:27:47.655692000 +0200
-+++ cmake/find/ldap.cmake 2021-09-13 15:28:02.970539000 +0200
-@@ -64,6 +64,7 @@ if (NOT OPENLDAP_FOUND AND NOT MISSING_INTERNAL_LDAP_L
- ( "${_system_name}" STREQUAL "linux" AND "${_system_processor}" STREQUAL "aarch64" ) OR
- ( "${_system_name}" STREQUAL "linux" AND "${_system_processor}" STREQUAL "ppc64le" ) OR
- ( "${_system_name}" STREQUAL "freebsd" AND "${_system_processor}" STREQUAL "x86_64" ) OR
-+ ( "${_system_name}" STREQUAL "freebsd" AND "${_system_processor}" STREQUAL "aarch64" ) OR
- ( "${_system_name}" STREQUAL "darwin" AND "${_system_processor}" STREQUAL "x86_64" ) OR
- ( "${_system_name}" STREQUAL "darwin" AND "${_system_processor}" STREQUAL "aarch64" )
- )
diff --git a/databases/clickhouse/files/patch-cmake_freebsd_default__libs.cmake b/databases/clickhouse/files/patch-cmake_freebsd_default__libs.cmake
index 70c32f8227bf..a83c7a0c08da 100644
--- a/databases/clickhouse/files/patch-cmake_freebsd_default__libs.cmake
+++ b/databases/clickhouse/files/patch-cmake_freebsd_default__libs.cmake
@@ -1,4 +1,4 @@
---- cmake/freebsd/default_libs.cmake.orig 2021-04-12 12:15:33 UTC
+--- cmake/freebsd/default_libs.cmake.orig 2021-12-26 09:29:33 UTC
+++ cmake/freebsd/default_libs.cmake
@@ -4,13 +4,13 @@ if (NOT COMPILER_CLANG)
message (FATAL_ERROR "FreeBSD build is supported only for Clang")
diff --git a/databases/clickhouse/files/patch-cmake_freebsd_toolchain-x86__64.cmake b/databases/clickhouse/files/patch-cmake_freebsd_toolchain-x86__64.cmake
new file mode 100644
index 000000000000..d38c6fa2514e
--- /dev/null
+++ b/databases/clickhouse/files/patch-cmake_freebsd_toolchain-x86__64.cmake
@@ -0,0 +1,14 @@
+--- cmake/freebsd/toolchain-x86_64.cmake.orig 2021-12-26 09:29:33 UTC
++++ cmake/freebsd/toolchain-x86_64.cmake
+@@ -1,8 +1,8 @@
+ set (CMAKE_SYSTEM_NAME "FreeBSD")
+ set (CMAKE_SYSTEM_PROCESSOR "x86_64")
+-set (CMAKE_C_COMPILER_TARGET "x86_64-pc-freebsd11")
+-set (CMAKE_CXX_COMPILER_TARGET "x86_64-pc-freebsd11")
+-set (CMAKE_ASM_COMPILER_TARGET "x86_64-pc-freebsd11")
++set (CMAKE_C_COMPILER_TARGET "x86_64-pc-freebsd13")
++set (CMAKE_CXX_COMPILER_TARGET "x86_64-pc-freebsd13")
++set (CMAKE_ASM_COMPILER_TARGET "x86_64-pc-freebsd13")
+ set (CMAKE_SYSROOT "${CMAKE_CURRENT_LIST_DIR}/../../contrib/sysroot/freebsd-x86_64")
+
+ set (CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) # disable linkage check - it doesn't work in CMake
diff --git a/databases/clickhouse/files/patch-cmake_tools.cmake b/databases/clickhouse/files/patch-cmake_tools.cmake
new file mode 100644
index 000000000000..9e7a474a7937
--- /dev/null
+++ b/databases/clickhouse/files/patch-cmake_tools.cmake
@@ -0,0 +1,11 @@
+--- cmake/tools.cmake.orig 2021-12-26 09:29:33 UTC
++++ cmake/tools.cmake
+@@ -40,7 +40,7 @@ elseif (COMPILER_CLANG)
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fchar8_t")
+ endif ()
+ else ()
+- set (CLANG_MINIMUM_VERSION 12)
++ set (CLANG_MINIMUM_VERSION 11)
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${CLANG_MINIMUM_VERSION})
+ message (FATAL_ERROR "Clang version must be at least ${CLANG_MINIMUM_VERSION}.")
+ endif ()
diff --git a/databases/clickhouse/files/patch-contrib_abseil-cpp_absl_copts_AbseilConfigureCopts.cmake b/databases/clickhouse/files/patch-contrib_abseil-cpp_absl_copts_AbseilConfigureCopts.cmake
new file mode 100644
index 000000000000..4db378c788b5
--- /dev/null
+++ b/databases/clickhouse/files/patch-contrib_abseil-cpp_absl_copts_AbseilConfigureCopts.cmake
@@ -0,0 +1,13 @@
+--- contrib/abseil-cpp/absl/copts/AbseilConfigureCopts.cmake.orig 2021-09-10 11:00:21 UTC
++++ contrib/abseil-cpp/absl/copts/AbseilConfigureCopts.cmake
+@@ -12,7 +12,9 @@ else()
+ set(ABSL_BUILD_DLL FALSE)
+ endif()
+
+-if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
++string (TOUPPER ${CMAKE_SYSTEM_PROCESSOR} CMAKE_SYSTEM_PROCESSOR_UC)
++
++if(CMAKE_SYSTEM_PROCESSOR_UC STREQUAL "X86_64" OR CMAKE_SYSTEM_PROCESSOR_UC STREQUAL "AMD64")
+ if (MSVC)
+ set(ABSL_RANDOM_RANDEN_COPTS "${ABSL_RANDOM_HWAES_MSVC_X64_FLAGS}")
+ else()
diff --git a/databases/clickhouse/files/patch-contrib_cassandra_CMakeLists.txt b/databases/clickhouse/files/patch-contrib_cassandra_CMakeLists.txt
index 733dc7778753..a60049c288d5 100644
--- a/databases/clickhouse/files/patch-contrib_cassandra_CMakeLists.txt
+++ b/databases/clickhouse/files/patch-contrib_cassandra_CMakeLists.txt
@@ -1,12 +1,11 @@
---- contrib/cassandra/CMakeLists.txt.orig 2021-01-25 21:26:46 UTC
+--- contrib/cassandra/CMakeLists.txt.orig 2021-05-28 13:12:55 UTC
+++ contrib/cassandra/CMakeLists.txt
-@@ -165,7 +165,8 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
+@@ -165,7 +165,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# Enable C++11 support to use std::atomic
if(CASS_USE_STD_ATOMIC)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
-+ set(CMAKE_CXX_STANDARD "17")
endif()
# OpenSSL is deprecated on later versions of Mac OS X. The long-term solution
diff --git a/databases/clickhouse/files/patch-contrib_grpc_third__party_cares_cares_CMakeLists.txt b/databases/clickhouse/files/patch-contrib_grpc_third__party_cares_cares_CMakeLists.txt
new file mode 100644
index 000000000000..e113926a7dd3
--- /dev/null
+++ b/databases/clickhouse/files/patch-contrib_grpc_third__party_cares_cares_CMakeLists.txt
@@ -0,0 +1,15 @@
+--- contrib/grpc/third_party/cares/cares/CMakeLists.txt.orig 2021-10-11 11:30:53 UTC
++++ contrib/grpc/third_party/cares/cares/CMakeLists.txt
+@@ -115,7 +115,11 @@ ENDIF ()
+ CHECK_LIBRARY_EXISTS (nsl gethostbyname "" HAVE_LIBNSL)
+ CHECK_LIBRARY_EXISTS (rt clock_gettime "" HAVE_LIBRT)
+
+-SET (HAVE_LIBRESOLV 1)
++# Look for dependent/required libraries
++CHECK_LIBRARY_EXISTS (resolv res_servicename "" HAVE_RES_SERVICENAME_IN_LIBRESOLV)
++IF (HAVE_RES_SERVICENAME_IN_LIBRESOLV)
++ SET (HAVE_LIBRESOLV 1)
++ENDIF ()
+
+ # Look for necessary includes
+ CHECK_INCLUDE_FILES (sys/types.h HAVE_SYS_TYPES_H)
diff --git a/databases/clickhouse/files/patch-contrib_jemalloc-cmake_CMakeLists.txt b/databases/clickhouse/files/patch-contrib_jemalloc-cmake_CMakeLists.txt
new file mode 100644
index 000000000000..404f3a7c00ff
--- /dev/null
+++ b/databases/clickhouse/files/patch-contrib_jemalloc-cmake_CMakeLists.txt
@@ -0,0 +1,13 @@
+--- contrib/jemalloc-cmake/CMakeLists.txt.orig 2021-12-26 09:29:33 UTC
++++ contrib/jemalloc-cmake/CMakeLists.txt
+@@ -19,8 +19,8 @@ if (NOT ENABLE_JEMALLOC)
+ return()
+ endif ()
+
+-if (NOT OS_LINUX)
+- message (WARNING "jemalloc support on non-linux is EXPERIMENTAL")
++if (NOT OS_LINUX AND NOT OS_FREEBSD)
++ message (WARNING "jemalloc support on non-linux and non-bsd is EXPERIMENTAL")
+ endif()
+
+ if (OS_LINUX)
diff --git a/databases/clickhouse/files/patch-contrib_jemalloc-cmake_include__freebsd__aarch64_jemalloc_internal_jemalloc__internal__defs.h.in b/databases/clickhouse/files/patch-contrib_jemalloc-cmake_include__freebsd__aarch64_jemalloc_internal_jemalloc__internal__defs.h.in
deleted file mode 100644
index 388d9bdec34a..000000000000
--- a/databases/clickhouse/files/patch-contrib_jemalloc-cmake_include__freebsd__aarch64_jemalloc_internal_jemalloc__internal__defs.h.in
+++ /dev/null
@@ -1,11 +0,0 @@
---- contrib/jemalloc-cmake/include_freebsd_aarch64/jemalloc/internal/jemalloc_internal_defs.h.in.orig 2021-07-22 13:50:06.073516000 +0200
-+++ contrib/jemalloc-cmake/include_freebsd_aarch64/jemalloc/internal/jemalloc_internal_defs.h.in 2021-07-22 13:50:28.909237000 +0200
-@@ -161,7 +161,7 @@
- * JEMALLOC_DSS enables use of sbrk(2) to allocate extents from the data storage
- * segment (DSS).
- */
--#define JEMALLOC_DSS
-+/* #undef JEMALLOC_DSS */
-
- /* Support memory filling (junk/zero). */
- #define JEMALLOC_FILL
diff --git a/databases/clickhouse/files/patch-contrib_krb5-cmake_autoconf__freebsd.h b/databases/clickhouse/files/patch-contrib_krb5-cmake_autoconf__freebsd.h
new file mode 100644
index 000000000000..474974c1df08
--- /dev/null
+++ b/databases/clickhouse/files/patch-contrib_krb5-cmake_autoconf__freebsd.h
@@ -0,0 +1,767 @@
+--- contrib/krb5-cmake/autoconf_freebsd.h.orig 2022-01-11 05:28:26 UTC
++++ contrib/krb5-cmake/autoconf_freebsd.h
+@@ -0,0 +1,764 @@
++/* include/autoconf.h. Generated from autoconf.h.in by configure. */
++/* include/autoconf.h.in. Generated from configure.in by autoheader. */
++
++
++#ifndef KRB5_AUTOCONF_H
++#define KRB5_AUTOCONF_H
++
++
++/* Define if AES-NI support is enabled */
++/* #undef AESNI */
++
++/* Define if socket can't be bound to 0.0.0.0 */
++/* #undef BROKEN_STREAMS_SOCKETS */
++
++/* Define if va_list objects can be simply copied by assignment. */
++/* #undef CAN_COPY_VA_LIST */
++
++/* Define to reduce code size even if it means more cpu usage */
++/* #undef CONFIG_SMALL */
++
++/* Define if __attribute__((constructor)) works */
++#define CONSTRUCTOR_ATTR_WORKS 1
++
++/* Define to default ccache name */
++#define DEFCCNAME "FILE:/tmp/krb5cc_%{uid}"
++
++/* Define to default client keytab name */
++#define DEFCKTNAME "FILE:/etc/krb5/user/%{euid}/client.keytab"
++
++/* Define to default keytab name */
++#define DEFKTNAME "FILE:/etc/krb5.keytab"
++
++/* Define if library initialization should be delayed until first use */
++#define DELAY_INITIALIZER 1
++
++/* Define if __attribute__((destructor)) works */
++#define DESTRUCTOR_ATTR_WORKS 1
++
++/* Define to disable PKINIT plugin support */
++#define DISABLE_PKINIT 1
++
++/* Define if LDAP KDB support within the Kerberos library (mainly ASN.1 code)
++ should be enabled. */
++/* #undef ENABLE_LDAP */
++
++/* Define if translation functions should be used. */
++/* #undef ENABLE_NLS */
++
++/* Define if thread support enabled */
++#define ENABLE_THREADS 1
++
++/* Define as return type of endrpcent */
++#define ENDRPCENT_TYPE void
++
++/* Define if Fortuna PRNG is selected */
++#define FORTUNA 1
++
++/* Define to the type of elements in the array set by `getgroups'. Usually
++ this is either `int' or `gid_t'. */
++#define GETGROUPS_T gid_t
++
++/* Define if gethostbyname_r returns int rather than struct hostent * */
++/* #undef GETHOSTBYNAME_R_RETURNS_INT */
++
++/* Type of getpeername second argument. */
++#define GETPEERNAME_ARG3_TYPE GETSOCKNAME_ARG3_TYPE
++
++/* Define if getpwnam_r exists but takes only 4 arguments (e.g., POSIX draft 6
++ implementations like some Solaris releases). */
++/* #undef GETPWNAM_R_4_ARGS */
++
++/* Define if getpwnam_r returns an int */
++#define GETPWNAM_R_RETURNS_INT 1
++
++/* Define if getpwuid_r exists but takes only 4 arguments (e.g., POSIX draft 6
++ implementations like some Solaris releases). */
++/* #undef GETPWUID_R_4_ARGS */
++
++/* Define if getservbyname_r returns int rather than struct servent * */
++/* #undef GETSERVBYNAME_R_RETURNS_INT */
++
++/* Type of pointer target for argument 3 to getsockname */
++#define GETSOCKNAME_ARG3_TYPE socklen_t
++
++/* Define if gmtime_r returns int instead of struct tm pointer, as on old
++ HP-UX systems. */
++/* #undef GMTIME_R_RETURNS_INT */
++
++/* Define if va_copy macro or function is available. */
++#define HAS_VA_COPY 1
++
++/* Define to 1 if you have the `access' function. */
++#define HAVE_ACCESS 1
++
++/* Define to 1 if you have the <alloca.h> header file. */
++#define HAVE_ALLOCA_H 1
++
++/* Define to 1 if you have the <arpa/inet.h> header file. */
++#define HAVE_ARPA_INET_H 1
++
++/* Define to 1 if you have the `bswap16' function. */
++/* #undef HAVE_BSWAP16 */
++
++/* Define to 1 if you have the `bswap64' function. */
++/* #undef HAVE_BSWAP64 */
++
++/* Define to 1 if bswap_16 is available via byteswap.h */
++/* #undef HAVE_BSWAP_16 */
++
++/* Define to 1 if bswap_64 is available via byteswap.h */
++/* #undef HAVE_BSWAP_64 */
++
++/* Define if bt_rseq is available, for recursive btree traversal. */
++#define HAVE_BT_RSEQ 1
++
++/* Define to 1 if you have the <byteswap.h> header file. */
++/* #undef HAVE_BYTESWAP_H */
++
++/* Define to 1 if you have the `chmod' function. */
++#define HAVE_CHMOD 1
++
++/* Define if cmocka library is available. */
++/* #undef HAVE_CMOCKA */
++
++/* Define to 1 if you have the `compile' function. */
++/* #undef HAVE_COMPILE */
++
++/* Define if com_err has compatible gettext support */
++#define HAVE_COM_ERR_INTL 1
++
++/* Define to 1 if you have the <cpuid.h> header file. */
++/* #undef HAVE_CPUID_H */
++
++/* Define to 1 if you have the `daemon' function. */
++#define HAVE_DAEMON 1
++
++/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
++ don't. */
++#define HAVE_DECL_STRERROR_R 1
++
++/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
++ */
++#define HAVE_DIRENT_H 1
++
++/* Define to 1 if you have the <dlfcn.h> header file. */
++#define HAVE_DLFCN_H 1
++
++/* Define to 1 if you have the `dn_skipname' function. */
++#define HAVE_DN_SKIPNAME 1
++
++/* Define to 1 if you have the <endian.h> header file. */
++/* #undef HAVE_ENDIAN_H */
++
++/* Define to 1 if you have the <errno.h> header file. */
++#define HAVE_ERRNO_H 1
++
++/* Define to 1 if you have the `fchmod' function. */
++#define HAVE_FCHMOD 1
++
++/* Define to 1 if you have the <fcntl.h> header file. */
++#define HAVE_FCNTL_H 1
++
++/* Define to 1 if you have the `flock' function. */
++#define HAVE_FLOCK 1
++
++/* Define to 1 if you have the `fnmatch' function. */
++#define HAVE_FNMATCH 1
++
++/* Define to 1 if you have the <fnmatch.h> header file. */
++#define HAVE_FNMATCH_H 1
++
++/* Define if you have the getaddrinfo function */
++#define HAVE_GETADDRINFO 1
++
++/* Define to 1 if you have the `getcwd' function. */
++#define HAVE_GETCWD 1
++
++/* Define to 1 if you have the `getenv' function. */
++#define HAVE_GETENV 1
++
++/* Define to 1 if you have the `geteuid' function. */
++#define HAVE_GETEUID 1
++
++/* Define if gethostbyname_r exists and its return type is known */
++/* #undef HAVE_GETHOSTBYNAME_R */
++
++/* Define to 1 if you have the `getnameinfo' function. */
++#define HAVE_GETNAMEINFO 1
++
++/* Define if system getopt should be used. */
++#define HAVE_GETOPT 1
++
++/* Define if system getopt_long should be used. */
++#define HAVE_GETOPT_LONG 1
++
++/* Define if getpwnam_r is available and useful. */
++#define HAVE_GETPWNAM_R 1
++
++/* Define if getpwuid_r is available and useful. */
++#define HAVE_GETPWUID_R 1
++
++/* Define if getservbyname_r exists and its return type is known */
++/* #undef HAVE_GETSERVBYNAME_R */
++
++/* Have the gettimeofday function */
++#define HAVE_GETTIMEOFDAY 1
++
++/* Define to 1 if you have the `getusershell' function. */
++#define HAVE_GETUSERSHELL 1
++
++/* Define to 1 if you have the `gmtime_r' function. */
++#define HAVE_GMTIME_R 1
++
++/* Define to 1 if you have the <ifaddrs.h> header file. */
++#define HAVE_IFADDRS_H 1
++
++/* Define to 1 if you have the `inet_ntop' function. */
++#define HAVE_INET_NTOP 1
++
++/* Define to 1 if you have the `inet_pton' function. */
++#define HAVE_INET_PTON 1
++
++/* Define to 1 if the system has the type `int16_t'. */
++#define HAVE_INT16_T 1
++
++/* Define to 1 if the system has the type `int32_t'. */
++#define HAVE_INT32_T 1
++
++/* Define to 1 if the system has the type `int8_t'. */
++#define HAVE_INT8_T 1
++
++/* Define to 1 if you have the <inttypes.h> header file. */
++#define HAVE_INTTYPES_H 1
++
++/* Define to 1 if you have the <keyutils.h> header file. */
++/* #undef HAVE_KEYUTILS_H */
++
++/* Define to 1 if you have the <lber.h> header file. */
++/* #undef HAVE_LBER_H */
++
++/* Define to 1 if you have the <ldap.h> header file. */
++/* #undef HAVE_LDAP_H */
++
++/* Define to 1 if you have the `crypto' library (-lcrypto). */
++#define HAVE_LIBCRYPTO 1
++
++/* Define if building with libedit. */
++/* #undef HAVE_LIBEDIT */
++
++/* Define to 1 if you have the `nsl' library (-lnsl). */
++/* #undef HAVE_LIBNSL */
++
++/* Define to 1 if you have the `resolv' library (-lresolv). */
++#define HAVE_LIBRESOLV 1
++
++/* Define to 1 if you have the `socket' library (-lsocket). */
++/* #undef HAVE_LIBSOCKET */
++
++/* Define if the util library is available */
++#define HAVE_LIBUTIL 1
++
++/* Define to 1 if you have the <limits.h> header file. */
++#define HAVE_LIMITS_H 1
++
++/* Define to 1 if you have the `localtime_r' function. */
++#define HAVE_LOCALTIME_R 1
++
++/* Define to 1 if you have the <machine/byte_order.h> header file. */
++#define HAVE_MACHINE_BYTE_ORDER_H 1
++
++/* Define to 1 if you have the <machine/endian.h> header file. */
++#define HAVE_MACHINE_ENDIAN_H 1
++
++/* Define to 1 if you have the <memory.h> header file. */
++#define HAVE_MEMORY_H 1
++
++/* Define to 1 if you have the `mkstemp' function. */
++#define HAVE_MKSTEMP 1
++
++/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
++/* #undef HAVE_NDIR_H */
++
++/* Define to 1 if you have the <netdb.h> header file. */
++#define HAVE_NETDB_H 1
++
++/* Define if netdb.h declares h_errno */
++#define HAVE_NETDB_H_H_ERRNO 1
++
++/* Define to 1 if you have the <netinet/in.h> header file. */
++#define HAVE_NETINET_IN_H 1
++
++/* Define to 1 if you have the `ns_initparse' function. */
++#define HAVE_NS_INITPARSE 1
++
++/* Define to 1 if you have the `ns_name_uncompress' function. */
++#define HAVE_NS_NAME_UNCOMPRESS 1
++
++/* Define if OpenSSL supports cms. */
++#define HAVE_OPENSSL_CMS 1
++
++/* Define to 1 if you have the <paths.h> header file. */
++#define HAVE_PATHS_H 1
++
++/* Define if persistent keyrings are supported */
++/* #undef HAVE_PERSISTENT_KEYRING */
++
++/* Define to 1 if you have the <poll.h> header file. */
++#define HAVE_POLL_H 1
++
++/* Define if #pragma weak references work */
++/* #undef HAVE_PRAGMA_WEAK_REF */
++
++/* Define if you have POSIX threads libraries and header files. */
++#define HAVE_PTHREAD 1
++
++/* Define to 1 if you have the `pthread_once' function. */
++#define HAVE_PTHREAD_ONCE 1
++
++/* Have PTHREAD_PRIO_INHERIT. */
++#define HAVE_PTHREAD_PRIO_INHERIT 1
++
++/* Define to 1 if you have the `pthread_rwlock_init' function. */
++#define HAVE_PTHREAD_RWLOCK_INIT 1
++
++/* Define if pthread_rwlock_init is provided in the thread library. */
++#define HAVE_PTHREAD_RWLOCK_INIT_IN_THREAD_LIB 1
++
++/* Define to 1 if you have the <pwd.h> header file. */
++#define HAVE_PWD_H 1
++
++/* Define if building with GNU Readline. */
++/* #undef HAVE_READLINE */
++
++/* Define if regcomp exists and functions */
++#define HAVE_REGCOMP 1
++
++/* Define to 1 if you have the `regexec' function. */
++#define HAVE_REGEXEC 1
++
++/* Define to 1 if you have the <regexpr.h> header file. */
++/* #undef HAVE_REGEXPR_H */
++
++/* Define to 1 if you have the <regex.h> header file. */
++#define HAVE_REGEX_H 1
++
++/* Define to 1 if you have the `res_nclose' function. */
++#define HAVE_RES_NCLOSE 1
++
++/* Define to 1 if you have the `res_ndestroy' function. */
++#define HAVE_RES_NDESTROY 1
++
++/* Define to 1 if you have the `res_ninit' function. */
++#define HAVE_RES_NINIT 1
++
++/* Define to 1 if you have the `res_nsearch' function. */
++#define HAVE_RES_NSEARCH 1
++
++/* Define to 1 if you have the `res_search' function */
++#define HAVE_RES_SEARCH 1
++
++/* Define to 1 if you have the `re_comp' function. */
++/* #undef HAVE_RE_COMP */
++
++/* Define to 1 if you have the `re_exec' function. */
++/* #undef HAVE_RE_EXEC */
++
++/* Define to 1 if you have the <sasl/sasl.h> header file. */
++/* #undef HAVE_SASL_SASL_H */
++
++/* Define if struct sockaddr contains sa_len */
++#define HAVE_SA_LEN 1
++
++/* Define to 1 if you have the `setegid' function. */
++#define HAVE_SETEGID 1
++
++/* Define to 1 if you have the `setenv' function. */
++#define HAVE_SETENV 1
++
++/* Define to 1 if you have the `seteuid' function. */
++#define HAVE_SETEUID 1
++
++/* Define if setluid provided in OSF/1 security library */
++/* #undef HAVE_SETLUID */
++
++/* Define to 1 if you have the `setregid' function. */
++#define HAVE_SETREGID 1
++
++/* Define to 1 if you have the `setresgid' function. */
++/* #undef HAVE_SETRESGID */
++
++/* Define to 1 if you have the `setresuid' function. */
++/* #undef HAVE_SETRESUID */
++
++/* Define to 1 if you have the `setreuid' function. */
++#define HAVE_SETREUID 1
++
++/* Define to 1 if you have the `setsid' function. */
++#define HAVE_SETSID 1
++
++/* Define to 1 if you have the `setvbuf' function. */
++#define HAVE_SETVBUF 1
++
++/* Define if there is a socklen_t type. If not, probably use size_t */
++#define HAVE_SOCKLEN_T 1
++
++/* Define to 1 if you have the `srand' function. */
++#define HAVE_SRAND 1
++
++/* Define to 1 if you have the `srand48' function. */
++#define HAVE_SRAND48 1
++
++/* Define to 1 if you have the `srandom' function. */
++#define HAVE_SRANDOM 1
++
++/* Define to 1 if the system has the type `ssize_t'. */
++#define HAVE_SSIZE_T 1
++
++/* Define to 1 if you have the `stat' function. */
++#define HAVE_STAT 1
++
++/* Define to 1 if you have the <stddef.h> header file. */
++#define HAVE_STDDEF_H 1
++
++/* Define to 1 if you have the <stdint.h> header file. */
++#define HAVE_STDINT_H 1
++
++/* Define to 1 if you have the <stdlib.h> header file. */
++#define HAVE_STDLIB_H 1
++
++/* Define to 1 if you have the `step' function. */
++/* #undef HAVE_STEP */
++
++/* Define to 1 if you have the `strchr' function. */
++#define HAVE_STRCHR 1
++
++/* Define to 1 if you have the `strdup' function. */
++#define HAVE_STRDUP 1
++
++/* Define to 1 if you have the `strerror' function. */
++#define HAVE_STRERROR 1
++
++/* Define to 1 if you have the `strerror_r' function. */
++#define HAVE_STRERROR_R 1
++
++/* Define to 1 if you have the <strings.h> header file. */
++#define HAVE_STRINGS_H 1
++
++/* Define to 1 if you have the <string.h> header file. */
++#define HAVE_STRING_H 1
++
++/* Define to 1 if you have the `strlcpy' function. */
++#define HAVE_STRLCPY 1
++
++/* Define to 1 if you have the `strptime' function. */
++#define HAVE_STRPTIME 1
++
++/* Define to 1 if the system has the type `struct cmsghdr'. */
++#define HAVE_STRUCT_CMSGHDR 1
++
++/* Define if there is a struct if_laddrconf. */
++/* #undef HAVE_STRUCT_IF_LADDRCONF */
++
++/* Define to 1 if the system has the type `struct in6_pktinfo'. */
++#define HAVE_STRUCT_IN6_PKTINFO 1
++
++/* Define to 1 if the system has the type `struct in_pktinfo'. */
++#define HAVE_STRUCT_IN_PKTINFO 1
++
++/* Define if there is a struct lifconf. */
++/* #undef HAVE_STRUCT_LIFCONF */
++
++/* Define to 1 if the system has the type `struct rt_msghdr'. */
++#define HAVE_STRUCT_RT_MSGHDR 1
++
++/* Define to 1 if the system has the type `struct sockaddr_storage'. */
++#define HAVE_STRUCT_SOCKADDR_STORAGE 1
++
++/* Define to 1 if `st_mtimensec' is a member of `struct stat'. */
++/* #undef HAVE_STRUCT_STAT_ST_MTIMENSEC */
++
++/* Define to 1 if `st_mtimespec.tv_nsec' is a member of `struct stat'. */
++#define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1
++
++/* Define to 1 if `st_mtim.tv_nsec' is a member of `struct stat'. */
++/* #undef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC */
++
++/* Define to 1 if you have the <sys/bswap.h> header file. */
++/* #undef HAVE_SYS_BSWAP_H */
++
++/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
++ */
++/* #undef HAVE_SYS_DIR_H */
++
++/* Define if sys_errlist in libc */
++#define HAVE_SYS_ERRLIST 1
++
++/* Define to 1 if you have the <sys/file.h> header file. */
++#define HAVE_SYS_FILE_H 1
++
++/* Define to 1 if you have the <sys/filio.h> header file. */
++#define HAVE_SYS_FILIO_H 1
++
++/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
++ */
++/* #undef HAVE_SYS_NDIR_H */
++
++/* Define to 1 if you have the <sys/param.h> header file. */
++#define HAVE_SYS_PARAM_H 1
++
++/* Define to 1 if you have the <sys/select.h> header file. */
++#define HAVE_SYS_SELECT_H 1
++
++/* Define to 1 if you have the <sys/socket.h> header file. */
++#define HAVE_SYS_SOCKET_H 1
++
++/* Define to 1 if you have the <sys/sockio.h> header file. */
++#define HAVE_SYS_SOCKIO_H 1
++
++/* Define to 1 if you have the <sys/stat.h> header file. */
++#define HAVE_SYS_STAT_H 1
++
++/* Define to 1 if you have the <sys/time.h> header file. */
++#define HAVE_SYS_TIME_H 1
++
++/* Define to 1 if you have the <sys/types.h> header file. */
++#define HAVE_SYS_TYPES_H 1
++
++/* Define to 1 if you have the <sys/uio.h> header file. */
++#define HAVE_SYS_UIO_H 1
++
++/* Define if tcl.h found */
++/* #undef HAVE_TCL_H */
++
++/* Define if tcl/tcl.h found */
++/* #undef HAVE_TCL_TCL_H */
++
++/* Define to 1 if you have the `timegm' function. */
++#define HAVE_TIMEGM 1
++
++/* Define to 1 if you have the <time.h> header file. */
++#define HAVE_TIME_H 1
++
++/* Define to 1 if you have the <unistd.h> header file. */
++#define HAVE_UNISTD_H 1
++
++/* Define to 1 if you have the `unsetenv' function. */
++#define HAVE_UNSETENV 1
++
++/* Define to 1 if the system has the type `u_char'. */
++#define HAVE_U_CHAR 1
++
++/* Define to 1 if the system has the type `u_int'. */
++#define HAVE_U_INT 1
++
++/* Define to 1 if the system has the type `u_int16_t'. */
++#define HAVE_U_INT16_T 1
++
++/* Define to 1 if the system has the type `u_int32_t'. */
++#define HAVE_U_INT32_T 1
++
++/* Define to 1 if the system has the type `u_int8_t'. */
++#define HAVE_U_INT8_T 1
++
++/* Define to 1 if the system has the type `u_long'. */
++#define HAVE_U_LONG 1
++
++/* Define to 1 if you have the `vasprintf' function. */
++#define HAVE_VASPRINTF 1
++
++/* Define to 1 if you have the `vsnprintf' function. */
++#define HAVE_VSNPRINTF 1
++
++/* Define to 1 if you have the `vsprintf' function. */
++#define HAVE_VSPRINTF 1
++
++/* Define to 1 if the system has the type `__int128_t'. */
++#define HAVE___INT128_T 1
++
++/* Define to 1 if the system has the type `__uint128_t'. */
++#define HAVE___UINT128_T 1
++
++/* Define if errno.h declares perror */
++/* #undef HDR_HAS_PERROR */
++
++/* May need to be defined to enable IPv6 support, for example on IRIX */
++/* #undef INET6 */
++
++/* Define if MIT Project Athena default configuration should be used */
++/* #undef KRB5_ATHENA_COMPAT */
++
++/* Define for DNS support of locating realms and KDCs */
++#undef KRB5_DNS_LOOKUP
++
++/* Define to enable DNS lookups of Kerberos realm names */
++/* #undef KRB5_DNS_LOOKUP_REALM */
++
++/* Define if the KDC should return only vague error codes to clients */
++/* #undef KRBCONF_VAGUE_ERRORS */
++
++/* define if the system header files are missing prototype for daemon() */
++#define NEED_DAEMON_PROTO 1
++
++/* Define if in6addr_any is not defined in libc */
++#define NEED_INSIXADDR_ANY 1
++
++/* define if the system header files are missing prototype for
++ ss_execute_command() */
++/* #undef NEED_SS_EXECUTE_COMMAND_PROTO */
++
++/* define if the system header files are missing prototype for strptime() */
++/* #undef NEED_STRPTIME_PROTO */
++
++/* define if the system header files are missing prototype for swab() */
++/* #undef NEED_SWAB_PROTO */
++
++/* Define if need to declare sys_errlist */
++/* #undef NEED_SYS_ERRLIST */
++
++/* define if the system header files are missing prototype for vasprintf() */
++/* #undef NEED_VASPRINTF_PROTO */
++
++/* Define if the KDC should use no lookaside cache */
++/* #undef NOCACHE */
++
++/* Define if references to pthread routines should be non-weak. */
++/* #undef NO_WEAK_PTHREADS */
++
++/* Define if lex produes code with yylineno */
++/* #undef NO_YYLINENO */
++
++/* Define to the address where bug reports for this package should be sent. */
++#define PACKAGE_BUGREPORT "krb5-bugs@mit.edu"
++
++/* Define to the full name of this package. */
++#define PACKAGE_NAME "Kerberos 5"
++
++/* Define to the full name and version of this package. */
++#define PACKAGE_STRING "Kerberos 5 1.17.1"
++
++/* Define to the one symbol short name of this package. */
++#define PACKAGE_TARNAME "krb5"
++
++/* Define to the home page for this package. */
++#define PACKAGE_URL ""
++
++/* Define to the version of this package. */
++#define PACKAGE_VERSION "1.17.1"
++
++/* Define if setjmp indicates POSIX interface */
++#define POSIX_SETJMP 1
++
++/* Define if POSIX signal handling is used */
++#define POSIX_SIGNALS 1
++
++/* Define if POSIX signal handlers are used */
++#define POSIX_SIGTYPE 1
++
++/* Define if termios.h exists and tcsetattr exists */
++#define POSIX_TERMIOS 1
++
++/* Define to necessary symbol if this constant uses a non-standard name on
++ your system. */
++/* #undef PTHREAD_CREATE_JOINABLE */
++
++/* Define as the return type of signal handlers (`int' or `void'). */
++#define RETSIGTYPE void
++
++/* Define as return type of setrpcent */
++#define SETRPCENT_TYPE void
++
++/* The size of `size_t', as computed by sizeof. */
++#define SIZEOF_SIZE_T 8
++
++/* The size of `time_t', as computed by sizeof. */
++#define SIZEOF_TIME_T 8
++
++/* Define to use OpenSSL for SPAKE preauth */
++#define SPAKE_OPENSSL 1
++
++/* Define for static plugin linkage */
++/* #undef STATIC_PLUGINS */
++
++/* Define to 1 if you have the ANSI C header files. */
++#define STDC_HEADERS 1
++
++/* Define to 1 if strerror_r returns char *. */
++/* #undef STRERROR_R_CHAR_P */
++
++/* Define if sys_errlist is defined in errno.h */
++#define SYS_ERRLIST_DECLARED 1
++
++/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
++#define TIME_WITH_SYS_TIME 1
++
++/* Define if no TLS implementation is selected */
++/* #undef TLS_IMPL_NONE */
++
++/* Define if TLS implementation is OpenSSL */
++#define TLS_IMPL_OPENSSL 1
++
++/* Define if you have dirent.h functionality */
++#define USE_DIRENT_H 1
++
++/* Define if dlopen should be used */
++#define USE_DLOPEN 1
++
++/* Define if the keyring ccache should be enabled */
++/* #undef USE_KEYRING_CCACHE */
++
++/* Define if link-time options for library finalization will be used */
++/* #undef USE_LINKER_FINI_OPTION */
++
++/* Define if link-time options for library initialization will be used */
++/* #undef USE_LINKER_INIT_OPTION */
++
++/* Define if sigprocmask should be used */
++#define USE_SIGPROCMASK 1
++
++/* Define if wait takes int as a argument */
++#define WAIT_USES_INT 1
++
++/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
++ `char[]'. */
++#define YYTEXT_POINTER 1
++
++/* Define to enable extensions in glibc */
++#define _GNU_SOURCE 1
++
++/* Define to enable C11 extensions */
++#define __STDC_WANT_LIB_EXT1__ 1
++
++/* Define to empty if `const' does not conform to ANSI C. */
++/* #undef const */
++
++/* Define to `int' if <sys/types.h> doesn't define. */
++/* #undef gid_t */
++
++/* Define to `__inline__' or `__inline' if that's what the C compiler
++ calls it, or to nothing if 'inline' is not supported under any name. */
++#ifndef __cplusplus
++/* #undef inline */
++#endif
++
++/* Define krb5_sigtype to type of signal handler */
++#define krb5_sigtype void
++
++/* Define to `int' if <sys/types.h> does not define. */
++/* #undef mode_t */
++
++/* Define to `long int' if <sys/types.h> does not define. */
++/* #undef off_t */
++
++/* Define to `long' if <sys/types.h> does not define. */
++/* #undef time_t */
++
++/* Define to `int' if <sys/types.h> doesn't define. */
++/* #undef uid_t */
++
++
++#if defined(__GNUC__) && !defined(inline)
++/* Silence gcc pedantic warnings about ANSI C. */
++# define inline __inline__
++#endif
++#endif /* KRB5_AUTOCONF_H */
diff --git a/databases/clickhouse/files/patch-contrib_rocksdb_util_crc32c.cc b/databases/clickhouse/files/patch-contrib_rocksdb_util_crc32c.cc
deleted file mode 100644
index 1c4a8699b3d2..000000000000
--- a/databases/clickhouse/files/patch-contrib_rocksdb_util_crc32c.cc
+++ /dev/null
@@ -1,38 +0,0 @@
---- contrib/rocksdb/util/crc32c.cc.orig 2021-07-21 16:35:20.404459000 +0200
-+++ contrib/rocksdb/util/crc32c.cc 2021-07-22 09:48:10.980923000 +0200
-@@ -41,7 +41,7 @@
-
- #endif
-
--#if defined(__linux__) && defined(HAVE_ARM64_CRC)
-+#if (defined(__FreeBSD__) || defined(__linux__)) && defined(HAVE_ARM64_CRC)
- bool pmull_runtime_flag = false;
- #endif
-
-@@ -474,7 +474,7 @@ static bool isAltiVec() {
- }
- #endif
-
--#if defined(__linux__) && defined(HAVE_ARM64_CRC)
-+#if (defined(__FreeBSD__) || defined(__linux__)) && defined(HAVE_ARM64_CRC)
- uint32_t ExtendARMImpl(uint32_t crc, const char *buf, size_t size) {
- return crc32c_arm64(crc, (const unsigned char *)buf, size);
- }
-@@ -494,7 +494,7 @@ std::string IsFastCrc32Supported() {
- has_fast_crc = false;
- arch = "PPC";
- #endif
--#elif defined(__linux__) && defined(HAVE_ARM64_CRC)
-+#elif (defined(__FreeBSD__) || defined(__linux__)) && defined(HAVE_ARM64_CRC)
- if (crc32c_runtime_check()) {
- has_fast_crc = true;
- arch = "Arm64";
-@@ -1227,7 +1227,7 @@ uint32_t crc32c_3way(uint32_t crc, const char* buf, si
- static inline Function Choose_Extend() {
- #ifdef HAVE_POWER8
- return isAltiVec() ? ExtendPPCImpl : ExtendImpl<Slow_CRC32>;
--#elif defined(__linux__) && defined(HAVE_ARM64_CRC)
-+#elif (defined(__FreeBSD__) || defined(__linux__)) && defined(HAVE_ARM64_CRC)
- if(crc32c_runtime_check()) {
- pmull_runtime_flag = crc32c_pmull_runtime_check();
- return ExtendARMImpl;
diff --git a/databases/clickhouse/files/patch-contrib_rocksdb_util_crc32c__arm64.cc b/databases/clickhouse/files/patch-contrib_rocksdb_util_crc32c__arm64.cc
deleted file mode 100644
index 1b37e82527ef..000000000000
--- a/databases/clickhouse/files/patch-contrib_rocksdb_util_crc32c__arm64.cc
+++ /dev/null
@@ -1,45 +0,0 @@
---- contrib/rocksdb/util/crc32c_arm64.cc.orig 2021-05-13 00:21:57.000000000 +0200
-+++ contrib/rocksdb/util/crc32c_arm64.cc 2000-01-01 02:32:56.500264000 +0100
-@@ -5,9 +5,11 @@
-
- #include "util/crc32c_arm64.h"
-
--#if defined(__linux__) && defined(HAVE_ARM64_CRC)
-+#if (defined(__FreeBSD__) || defined(__linux__)) && defined(HAVE_ARM64_CRC)
-
-+#if defined(__linux__)
- #include <asm/hwcap.h>
-+#endif // linux
- #ifdef ROCKSDB_AUXV_GETAUXVAL_PRESENT
- #include <sys/auxv.h>
- #endif
-@@ -42,7 +44,14 @@ extern bool pmull_runtime_flag;
-
- uint32_t crc32c_runtime_check(void) {
- #ifdef ROCKSDB_AUXV_GETAUXVAL_PRESENT
-+#if defined(__FreeBSD__)
-+ uint64_t auxv;
-+ int result = elf_aux_info(AT_HWCAP, &auxv, sizeof auxv);
-+ if (result != 0)
-+ return 0;
-+#else
- uint64_t auxv = getauxval(AT_HWCAP);
-+#endif
- return (auxv & HWCAP_CRC32) != 0;
- #else
- return 0;
-@@ -51,7 +60,14 @@ uint32_t crc32c_runtime_check(void) {
-
- bool crc32c_pmull_runtime_check(void) {
- #ifdef ROCKSDB_AUXV_GETAUXVAL_PRESENT
-+#if defined(__FreeBSD__)
-+ uint64_t auxv;
-+ int result = elf_aux_info(AT_HWCAP, &auxv, sizeof auxv);
-+ if (result != 0)
-+ return 0;
-+#else
- uint64_t auxv = getauxval(AT_HWCAP);
-+#endif
- return (auxv & HWCAP_PMULL) != 0;
- #else
- return false;
diff --git a/databases/clickhouse/files/patch-src_Common_MemoryStatisticsOS.cpp b/databases/clickhouse/files/patch-src_Common_MemoryStatisticsOS.cpp
index de0458181f69..b5a3d52c9114 100644
--- a/databases/clickhouse/files/patch-src_Common_MemoryStatisticsOS.cpp
+++ b/databases/clickhouse/files/patch-src_Common_MemoryStatisticsOS.cpp
@@ -1,11 +1,15 @@
---- src/Common/MemoryStatisticsOS.cpp.orig 2021-03-19 11:39:14 UTC
+--- src/Common/MemoryStatisticsOS.cpp.orig 2021-12-26 09:29:33 UTC
+++ src/Common/MemoryStatisticsOS.cpp
-@@ -1,14 +1,20 @@
+@@ -1,4 +1,4 @@
-#if defined(OS_LINUX)
--
++#if defined(OS_LINUX) || defined(OS_FREEBSD)
+
#include <sys/types.h>
#include <sys/stat.h>
-+
+@@ -6,6 +6,13 @@
+ #include <unistd.h>
+ #include <cassert>
+
+#ifdef OS_FREEBSD
+#include <sys/param.h>
+#include <sys/sysctl.h>
@@ -13,18 +17,10 @@
+#include <libprocstat.h>
+#endif
+
- #include <fcntl.h>
- #include <unistd.h>
- #include <cassert>
-
#include "MemoryStatisticsOS.h"
--#include <common/logger_useful.h>
-+//#include <common/logger_useful.h>
- #include <common/getPageSize.h>
- #include <Common/Exception.h>
- #include <IO/ReadBufferFromMemory.h>
-@@ -24,20 +30,40 @@ namespace ErrorCodes
+ #include <base/logger_useful.h>
+@@ -24,20 +31,40 @@ namespace ErrorCodes
extern const int CANNOT_OPEN_FILE;
extern const int CANNOT_READ_FROM_FILE_DESCRIPTOR;
extern const int CANNOT_CLOSE_FILE;
@@ -66,7 +62,7 @@
if (0 != ::close(fd))
{
try
-@@ -51,12 +77,42 @@ MemoryStatisticsOS::~MemoryStatisticsOS()
+@@ -51,12 +78,42 @@ MemoryStatisticsOS::~MemoryStatisticsOS()
DB::tryLogCurrentException(__PRETTY_FUNCTION__);
}
}
@@ -109,7 +105,7 @@
constexpr size_t buf_size = 1024;
char buf[buf_size];
-@@ -99,10 +155,8 @@ MemoryStatisticsOS::Data MemoryStatisticsOS::get() con
+@@ -99,7 +156,7 @@ MemoryStatisticsOS::Data MemoryStatisticsOS::get() con
data.shared *= page_size;
data.code *= page_size;
data.data_and_stack *= page_size;
@@ -118,6 +114,3 @@
return data;
}
- }
--
--#endif
diff --git a/databases/clickhouse/files/patch-src_Common_StackTrace.cpp b/databases/clickhouse/files/patch-src_Common_StackTrace.cpp
deleted file mode 100644
index bac5c5e25a8d..000000000000
--- a/databases/clickhouse/files/patch-src_Common_StackTrace.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/Common/StackTrace.cpp.orig 2021-09-13 15:30:01.608345000 +0200
-+++ src/Common/StackTrace.cpp 2021-09-13 15:30:10.009331000 +0200
-@@ -186,6 +186,8 @@ static void * getCallerAddress(const ucontext_t & context)
- #elif defined(__APPLE__) && defined(__aarch64__)
- return reinterpret_cast<void *>(context.uc_mcontext->__ss.__pc);
-
-+#elif defined(__FreeBSD__) && defined(__aarch64__)
-+ return reinterpret_cast<void *>(context.uc_mcontext.mc_gpregs.gp_elr);
- #elif defined(__aarch64__)
- return reinterpret_cast<void *>(context.uc_mcontext.pc);
- #elif defined(__powerpc64__)
diff --git a/databases/clickhouse/files/patch-src_Interpreters_AsynchronousMetrics.cpp b/databases/clickhouse/files/patch-src_Interpreters_AsynchronousMetrics.cpp
deleted file mode 100644
index 53cb1e3a2823..000000000000
--- a/databases/clickhouse/files/patch-src_Interpreters_AsynchronousMetrics.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/Interpreters/AsynchronousMetrics.cpp.orig 2021-07-17 10:04:30 UTC
-+++ src/Interpreters/AsynchronousMetrics.cpp
-@@ -207,7 +207,7 @@ void AsynchronousMetrics::update()
- new_values["Uptime"] = getContext()->getUptimeSeconds();
-
- /// Process memory usage according to OS
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_FREEBSD)
- {
- MemoryStatisticsOS::Data data = memory_stat.get();
-
diff --git a/databases/clickhouse/files/patch-src_Interpreters_AsynchronousMetrics.h b/databases/clickhouse/files/patch-src_Interpreters_AsynchronousMetrics.h
deleted file mode 100644
index 6eecdbacede0..000000000000
--- a/databases/clickhouse/files/patch-src_Interpreters_AsynchronousMetrics.h
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/Interpreters/AsynchronousMetrics.h.orig 2021-03-19 11:39:14 UTC
-+++ src/Interpreters/AsynchronousMetrics.h
-@@ -78,7 +78,7 @@ class AsynchronousMetrics (private)
- bool quit {false};
- AsynchronousMetricValues values;
-
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_FREEBSD)
- MemoryStatisticsOS memory_stat;
- #endif
-