build: v6.2.0 — disable AVX-512 autovec, fix v6.1.9 SIGILL

v6.1.9 was built on a GitHub Actions EPYC 7763 runner (AVX-512 capable)
and contained 741 vpbroadcastq EVEX instructions in inlined libstdc++
std::string paths. The resulting binary crashed with SIGILL on every
production node: KVM EPYC (DNS2), Ryzen 5 3600 (SAMI-PC), and any
non-x86_64 node.

cmake/AddCompilerFlags.cmake already set -march=x86-64-v2 -mtune=generic
but GCC 11.4 + libstdc++ inlining still autovectorized some paths to
AVX-512. The fix adds an explicit -mno-avx512f -mno-avx512* block
inside CMAKE_X86_64_BASELINE so the build cannot leak AVX-512 regardless
of the build host's capabilities.

Carries forward the v6.1.9 staking-selfheal fix (f69f087) unchanged.
Bump version 6.1.9 -> 6.2.0 to reflect the build-system change.

See references/avx-512-sigill-build-fix.md for the full diagnosis
recipe and the verification steps.
This commit is contained in:
Sami Ahmed
2026-08-01 13:35:54 -07:00
parent 668c64276f
commit 8a48b308a8
14 changed files with 242 additions and 23 deletions
+20
View File
@@ -77,6 +77,26 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|AMD64)$" AND NOT WIN32 AND NOT
# build host. Combined with -march=x86-64-v2 above, the scheduler
# picks instructions from the v2 subset only — no AVX-512 leaks.
add_compile_options(-mtune=generic)
# Belt-and-suspenders: explicitly disable AVX-512 / AVX10 / SVE
# family ISAs that GCC 11+ can otherwise autovectorize into via
# inlined libstdc++ std::string / std::copy / memcpy paths even when
# -march=x86-64-v2 is set. Discovered 2026-08-01: v6.1.9 binary built
# on EPYC 7763 (AVX-512) contained 741 vpbroadcastq EVEX instructions
# which crash with SIGILL on every production node (KVM EPYC,
# Ryzen 3600, ARM64) that lacks AVX-512. -mno-avx512f alone is
# enough to suppress the SIGILL; the -mno-*avx10/sve* siblings
# future-proof against the next GCC version autovectorizing
# beyond AVX-512. See references/avx-512-sigill-build-fix.md
# for the full diagnosis recipe.
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
add_compile_options(
-mno-avx512f -mno-avx512pf -mno-avx512er -mno-avx512cd
-mno-avx512vl -mno-avx512bw -mno-avx512dq -mno-avx512ifma
-mno-avx512vbmi -mno-avx512vbmi2 -mno-avx512vnni
-mno-avx512bitalg -mno-avx512vpopcntdq -mno-avx512-4fmaps
-mno-avx512-4vnniw -mno-avx512vp2intersect
)
endif()
endif()
endif()