Repository navigation
[8.2] MOD-14130 Fix build failures on focal cross-compilation and x86 with old binutils - #1125
Conversation
… with old binutils (#912) * Fix SVE benchmark compilation bug on aarch64 In the OPT_SVE blocks, the code incorrectly referenced sve2_supported (only defined in OPT_SVE2 block) instead of sve_supported, causing compilation errors when OPT_SVE is defined but OPT_SVE2 is not. * Fix cross-compilation: use CMAKE_SYSTEM_PROCESSOR instead of CMAKE_HOST_SYSTEM_PROCESSOR CMAKE_HOST_SYSTEM_PROCESSOR returns the host machine's architecture (where CMake runs), while CMAKE_SYSTEM_PROCESSOR returns the target architecture (what we're building for). In cross-compilation scenarios (e.g., building ARM binaries on an x86 CI runner), these differ. Using CMAKE_HOST_SYSTEM_PROCESSOR caused x86 AVX512 instructions to be compiled when cross-compiling for ARM, resulting in assembler errors like: Error: no such instruction: 'vfmadd132ph %zmm2,%zmm1,%zmm0{%k1}' * Fix AVX512-FP16 build on systems with old binutils The compiler (GCC 13+) may support -mavx512fp16 flag, but the assembler (binutils) may be too old to handle the generated AVX512-FP16 instructions. This caused build failures on Ubuntu 20.04 (focal) which has: - GCC 13.1.0 (installed via PPA) - supports AVX512-FP16 - binutils 2.34 (system default) - does NOT support AVX512-FP16 AVX512-FP16 instructions (vfmadd132ph, vmovw, vcvtsh2ss, etc.) require binutils >= 2.38. Replace the hardcoded Ubuntu 18.04 check with proper binutils version detection: - AVX512-BF16: requires binutils >= 2.34 - AVX512-FP16: requires binutils >= 2.38 (cherry picked from commit e5784b1)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.2 #1125 +/- ##
=======================================
Coverage 96.96% 96.96%
=======================================
Files 126 126
Lines 7371 7371
=======================================
Hits 7147 7147
Misses 224 224 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add Ubuntu 26.04 install script for the new ubuntu-latest runner GitHub's ubuntu-latest image moved to Ubuntu 26.04, and install_script.sh failed with "ubuntu_26.04.sh: No such file or directory". apt.llvm.org has no LLVM 18 repo for 26.04 (resolute), so install clang-format-18 from the Ubuntu archive and point the unversioned clang-format used by check-format.sh at it. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 4d9e4d2)
|
CI status: |
Fix std::vector::swap assertion failure with GCC 15 GCC 15 (Fedora 43) auto-enables _GLIBCXX_ASSERTIONS in unoptimized builds (-O0). This activates a runtime check in std::vector::swap (stl_vector.h:1847) that requires either propagate_on_container_swap to be true_type, or the two allocators to compare equal. TieredHNSW_BatchIterator::getNextResults swaps result vectors across allocator boundaries: flat_results (management-layer allocator) is swapped with the VecSimQueryReply returned by the frontend BF index (frontend allocator), and similarly for hnsw_results. These allocators are distinct VecSimAllocator instances, so operator== returns false, triggering __glibcxx_assert_fail -> abort(). Adding propagate_on_container_swap = true_type to VecsimSTLAllocator is safe because all VecSimAllocator instances use the same underlying allocation functions — they differ only in memory-tracking bookkeeping, not in actual alloc/free behavior. (cherry picked from commit 5bcc53e)
|
Also cherry-picked 5bcc53e (MOD-14977, #938): GCC 15 on the 26.04 image enables |
Backport of #912 to 8.2 (clean cherry-pick of e5784b1).
Why now: RediSearchEnterprise snapshot builds for RSE 8.2 fail on the Ubuntu Focal x86_64 job (
Build + Pack (RoR)) withError: no such instruction: vfmadd231ph .... The job builds with a newer GCC inside the focal container, whose binutils is 2.34. GCC accepts-mavx512fp16, so CMake enables the FP16 kernels, but the assembler cannot emit them. RediSearch 8.2 pins VecSim 8.2, so the fix must land here before the Search pin can be bumped.What changes: the hardcoded Ubuntu 18.04 check in
cmake/x86_64InstructionFlags.cmakeis replaced by a binutils version check (CXX_AVX512BF16off below 2.34,CXX_AVX512FP16off below 2.38);src/VecSim/spaces/CMakeLists.txtgates onCMAKE_SYSTEM_PROCESSORinstead of the host's; the SVE benchmark fix from the original PR is included as-is.Validation: ran the cmake flags file under
cmake -Pwith a stubbed compiler check and a fakeasreporting a chosen version. FP16 and BF16 both off at 2.30; FP16 off, BF16 on at 2.34; both on at 2.38 and 2.42.Follow-up: bump
deps/VectorSimilarityon RediSearch 8.2, then RSE 8.2 picks it up via the daily bump.CI note: GitHub moved
ubuntu-latestto Ubuntu 26.04 (GCC 15, binutils 2.44, clang-format 18) and this branch's PR CI had not run on it before. The PR therefore also carries two CI-only cherry-picks from main, both unrelated to the binutils change:.install/ubuntu_26.04.sh(from Add Ubuntu 26.04 install script for the ubuntu-latest runner #1111). Without itbasic testsandsanitizerfailed in the install step; the same break closed [8.8] [MOD-18996] Transfer allocation accounting between allocators #1117 on 8.8.propagate_on_container_swaponVecsimSTLAllocator(MOD-14977, MOD-14977 Fix std::vector::swap assertion failure with GCC 15 #938). GCC 15 enables_GLIBCXX_ASSERTIONSat -O0 and the tiered batch-iterator tests abort instd::vector::swapwithout it.🤖 Generated with Claude Code