Files
Alexey Milovidov d6dd46d4a7 Build crc32c on all architectures so snappy HTTP works everywhere
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
2026-04-26 03:44:20 +00:00
..