From 066fbfff0ef349f38d7f7c1dc8f7eaf71b2ce92b Mon Sep 17 00:00:00 2001 From: Mikhail Filimonov Date: Thu, 21 Jan 2021 16:04:55 +0100 Subject: [PATCH 1/3] librdkafka support for arm64 --- base/glibc-compatibility/CMakeLists.txt | 9 ++++++--- cmake/find/rdkafka.cmake | 16 +++------------- contrib/librdkafka-cmake/config.h.in | 4 ++-- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/base/glibc-compatibility/CMakeLists.txt b/base/glibc-compatibility/CMakeLists.txt index eb9d8db454d..684c6162941 100644 --- a/base/glibc-compatibility/CMakeLists.txt +++ b/base/glibc-compatibility/CMakeLists.txt @@ -27,9 +27,12 @@ if (GLIBC_COMPATIBILITY) list(APPEND glibc_compatibility_sources musl/getentropy.c) endif() - add_library (clickhouse_memcpy OBJECT - ${ClickHouse_SOURCE_DIR}/contrib/FastMemcpy/memcpy_wrapper.c - ) + if (NOT ARCH_ARM) + # clickhouse_memcpy don't support ARCH_ARM, see https://github.com/ClickHouse/ClickHouse/issues/18951 + add_library (clickhouse_memcpy OBJECT + ${ClickHouse_SOURCE_DIR}/contrib/FastMemcpy/memcpy_wrapper.c + ) + endif() # Need to omit frame pointers to match the performance of glibc set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer") diff --git a/cmake/find/rdkafka.cmake b/cmake/find/rdkafka.cmake index bf7028feb02..f6460c1d9a3 100644 --- a/cmake/find/rdkafka.cmake +++ b/cmake/find/rdkafka.cmake @@ -1,8 +1,4 @@ -if (NOT ARCH_ARM) - option (ENABLE_RDKAFKA "Enable kafka" ${ENABLE_LIBRARIES}) -elseif(ENABLE_RDKAFKA) - message (${RECONFIGURE_MESSAGE_LEVEL} "librdafka is not supported on ARM") -endif () +option (ENABLE_RDKAFKA "Enable kafka" ${ENABLE_LIBRARIES}) if (NOT ENABLE_RDKAFKA) if (USE_INTERNAL_RDKAFKA_LIBRARY) @@ -11,11 +7,7 @@ if (NOT ENABLE_RDKAFKA) return() endif() -if (NOT ARCH_ARM) - option (USE_INTERNAL_RDKAFKA_LIBRARY "Set to FALSE to use system librdkafka instead of the bundled" ${NOT_UNBUNDLED}) -elseif(USE_INTERNAL_RDKAFKA_LIBRARY) - message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal librdkafka with ARCH_ARM=${ARCH_ARM}") -endif () +option (USE_INTERNAL_RDKAFKA_LIBRARY "Set to FALSE to use system librdkafka instead of the bundled" ${NOT_UNBUNDLED}) if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/cppkafka/CMakeLists.txt") if(USE_INTERNAL_RDKAFKA_LIBRARY) @@ -65,14 +57,12 @@ if (RDKAFKA_LIB AND RDKAFKA_INCLUDE_DIR) if (LZ4_LIBRARY) list (APPEND RDKAFKA_LIBRARY ${LZ4_LIBRARY}) endif () -elseif (NOT MISSING_INTERNAL_RDKAFKA_LIBRARY AND NOT MISSING_INTERNAL_CPPKAFKA_LIBRARY AND NOT ARCH_ARM) +elseif (NOT MISSING_INTERNAL_RDKAFKA_LIBRARY AND NOT MISSING_INTERNAL_CPPKAFKA_LIBRARY) set (USE_INTERNAL_RDKAFKA_LIBRARY 1) set (RDKAFKA_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/librdkafka/src") set (RDKAFKA_LIBRARY rdkafka) set (CPPKAFKA_LIBRARY cppkafka) set (USE_RDKAFKA 1) -elseif(ARCH_ARM) - message (${RECONFIGURE_MESSAGE_LEVEL} "Using internal rdkafka on ARM is not supported") endif () message (STATUS "Using librdkafka=${USE_RDKAFKA}: ${RDKAFKA_INCLUDE_DIR} : ${RDKAFKA_LIBRARY} ${CPPKAFKA_LIBRARY}") diff --git a/contrib/librdkafka-cmake/config.h.in b/contrib/librdkafka-cmake/config.h.in index 29e833959f7..9057af2bff9 100644 --- a/contrib/librdkafka-cmake/config.h.in +++ b/contrib/librdkafka-cmake/config.h.in @@ -1,7 +1,6 @@ // Originally generated by ./configure #ifndef _CONFIG_H_ #define _CONFIG_H_ -#define ARCH "x86_64" #define BUILT_WITH "GCC GXX PKGCONFIG OSXLD LIBDL PLUGINS ZLIB SSL SASL_CYRUS ZSTD HDRHISTOGRAM LZ4_EXT SNAPPY SOCKEM SASL_SCRAM CRC32C_HW" #define CPU "generic" @@ -67,7 +66,8 @@ #cmakedefine WITH_SASL_OAUTHBEARER 1 #cmakedefine WITH_SASL_CYRUS 1 // crc32chw -#if !defined(__PPC__) +// actually some arch cpus may have hw crc, feature detection can be added. +#if !defined(__aarch64__) && !defined(__PPC__) #define WITH_CRC32C_HW 1 #endif // regex From 2adcde89f81a69fce1f36326c4b92880f288b8dd Mon Sep 17 00:00:00 2001 From: filimonov <1549571+filimonov@users.noreply.github.com> Date: Fri, 22 Jan 2021 09:52:59 +0100 Subject: [PATCH 2/3] use __ARM_FEATURE_CRC32 --- contrib/librdkafka-cmake/config.h.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/librdkafka-cmake/config.h.in b/contrib/librdkafka-cmake/config.h.in index 9057af2bff9..80b6ea61b6e 100644 --- a/contrib/librdkafka-cmake/config.h.in +++ b/contrib/librdkafka-cmake/config.h.in @@ -66,8 +66,7 @@ #cmakedefine WITH_SASL_OAUTHBEARER 1 #cmakedefine WITH_SASL_CYRUS 1 // crc32chw -// actually some arch cpus may have hw crc, feature detection can be added. -#if !defined(__aarch64__) && !defined(__PPC__) +#if !defined(__PPC__) && (!defined(__aarch64__) || defined(__ARM_FEATURE_CRC32)) #define WITH_CRC32C_HW 1 #endif // regex From 60278279744ab869bfe3aa39b726655e202b60cd Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com> Date: Sat, 23 Jan 2021 02:05:18 +0300 Subject: [PATCH 3/3] Update run-fuzzer.sh --- docker/test/fuzzer/run-fuzzer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/test/fuzzer/run-fuzzer.sh b/docker/test/fuzzer/run-fuzzer.sh index ce68bad4094..e92bb056f90 100755 --- a/docker/test/fuzzer/run-fuzzer.sh +++ b/docker/test/fuzzer/run-fuzzer.sh @@ -175,7 +175,7 @@ case "$stage" in # Lost connection to the server. This probably means that the server died # with abort. echo "failure" > status.txt - if ! grep -ao "Received signal.*\|Logical error.*\|Assertion.*failed\|Failed assertion.*\|.*runtime error: .*\|.*is located.*\|SUMMARY: MemorySanitizer:.*" server.log > description.txt + if ! grep -ao "Received signal.*\|Logical error.*\|Assertion.*failed\|Failed assertion.*\|.*runtime error: .*\|.*is located.*\|SUMMARY: MemorySanitizer:.*\|SUMMARY: ThreadSanitizer:.*" server.log > description.txt then echo "Lost connection to server. See the logs" > description.txt fi