mirror of
https://github.com/hanzoai/datastore.git
synced 2026-10-30 14:48:37 +00:00
The snappy framing format used by `SnappyWriteBuffer`/`SnappyFramedReadBuffer`
needs `crc32c::Crc32c` for chunk checksums, but `ch_contrib::crc32c` was only
built when `ENABLE_GOOGLE_CLOUD_CPP` was on. That option is gated on
`(OS_LINUX OR OS_DARWIN OR OS_FREEBSD) AND (ARCH_AMD64 OR (ARCH_AARCH64 AND NOT NO_ARMV81_OR_HIGHER))`,
so on `arm_v80compat`, `ppc64le`, `riscv64`, `s390x`, `loongarch64` the
`target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::snappy ch_contrib::crc32c)`
line failed cmake configuration with:
Target "clickhouse_common_io" links to: ch_contrib::crc32c
but the target was not found.
Move `add_contrib (crc32c-cmake crc32c)` out of the `ENABLE_GOOGLE_CLOUD_CPP`
block so the library is always built. Update `crc32c-cmake/CMakeLists.txt` to
pick a config header for every architecture: keep the existing AArch64+ARMv8.1+
and AMD64 paths, and add a portable little-endian config (`generic/`) for
ARMv8.0 compat / ppc64le / riscv64 / loongarch64 plus a big-endian one
(`generic_be/`) for s390x.
Build report (cmake configuration failures on cross-platform builds):
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100752&sha=85b9d5f0e497043b5d1d1ecf66ec6c1614c0dbf0
PR: https://github.com/ClickHouse/ClickHouse/pull/100752
37 lines
1.3 KiB
C++
37 lines
1.3 KiB
C++
// Copyright 2017 The CRC32C Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
|
|
|
#ifndef CRC32C_CRC32C_CONFIG_H_
|
|
#define CRC32C_CRC32C_CONFIG_H_
|
|
|
|
// Define to 1 if building for a big-endian platform.
|
|
#define BYTE_ORDER_BIG_ENDIAN 0
|
|
|
|
// Define to 1 if the compiler has the __builtin_prefetch intrinsic.
|
|
#define HAVE_BUILTIN_PREFETCH 0
|
|
|
|
// Define to 1 if targeting X86 and the compiler has the _mm_prefetch intrinsic.
|
|
#define HAVE_MM_PREFETCH 0
|
|
|
|
// Define to 1 if targeting X86 and the compiler has the _mm_crc32_u{8,32,64}
|
|
// intrinsics.
|
|
#define HAVE_SSE42 0
|
|
|
|
// Define to 1 if targeting ARM and the compiler has the __crc32c{b,h,w,d} and
|
|
// the vmull_p64 intrinsics.
|
|
#define HAVE_ARM64_CRC32C 0
|
|
|
|
// Define to 1 if the system libraries have the getauxval function in the
|
|
// <sys/auxv.h> header. Should be true on Linux and Android API level 20+.
|
|
#define HAVE_STRONG_GETAUXVAL 0
|
|
|
|
// Define to 1 if the compiler supports defining getauxval as a weak symbol.
|
|
// Should be true for any compiler that supports __attribute__((weak)).
|
|
#define HAVE_WEAK_GETAUXVAL 0
|
|
|
|
// Define to 1 if CRC32C tests have been built with Google Logging.
|
|
#define CRC32C_TESTS_BUILT_WITH_GLOG 0
|
|
|
|
#endif // CRC32C_CRC32C_CONFIG_H_
|