-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[improvement](build) Upgrade Snappy to 1.2.1 and enable SIMD paths #67727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -616,12 +616,28 @@ build_snappy() { | |
| sed -i 's/-fno-rtti/-frtti/g' CMakeLists.txt | ||
| fi | ||
|
|
||
| local snappy_cxx_flags="-O3" | ||
| case "$(uname -m)" in | ||
| x86_64) | ||
| # Match the BE's SSE4.2 baseline and optional AVX2 target. | ||
| snappy_cxx_flags+=" -msse4.2" | ||
| case "${USE_AVX2:-ON}" in | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] Normalize This case does not use the same truth table as the BE's later |
||
| 0 | OFF | off | FALSE | false | NO | no) ;; | ||
| *) snappy_cxx_flags+=" -mavx2" ;; | ||
| esac | ||
| ;; | ||
| aarch64 | arm64) | ||
| # Match the BE ARM baseline so Snappy can use NEON CRC32 hashing. | ||
| snappy_cxx_flags+=" -march=${ARM_MARCH:-armv8-a+crc}" | ||
| ;; | ||
| esac | ||
|
|
||
| mkdir -p "${BUILD_DIR}" | ||
| cd "${BUILD_DIR}" | ||
|
|
||
| rm -rf CMakeCache.txt CMakeFiles/ | ||
|
|
||
| CFLAGS="-O3" CXXFLAGS="-O3" "${CMAKE_CMD}" -G "${GENERATOR}" -DCMAKE_INSTALL_PREFIX="${TP_INSTALL_DIR}" \ | ||
| CFLAGS="-O3" CXXFLAGS="${snappy_cxx_flags}" "${CMAKE_CMD}" -G "${GENERATOR}" -DCMAKE_INSTALL_PREFIX="${TP_INSTALL_DIR}" \ | ||
| -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ | ||
| -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ | ||
| -DCMAKE_INSTALL_INCLUDEDIR="${TP_INCLUDE_DIR}"/snappy \ | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] Tie this ISA-specific archive to the BE target
The installed
libsnappy.ais now target-specific, but its lifetime is not tied to the BE target. The published x86/ARM build images run this script with the defaults, whilebuild.shreuses any complete third-party tree solely by checking the last unrelated library. Consequentlybuild-for-release.sh --noavx2can compile BE without AVX2 but link this default AVX2 archive; similarly,ARM_MARCH=armv8-acan reuse the default+crcarchive. Upstream Snappy 1.2.1 has reachable unconditional_mm256_*operations under__AVX__and emits ARM CRC instructions when built with+crc. The BE startup check cannot catch the mismatch because its AVX probes are compiled from the BE's own target macros, and the ARM path does not probe CRC. These nominal lower-target packages can thereforeSIGILLon the CPUs they are intended to support. Please keep the reusable archive at the baseline, add target-specific variants/runtime dispatch, or fingerprint it and force selection/rebuild whenever the BE target changes.