From 7ce2debb65b1274a54e373b208f13efe26bc7551 Mon Sep 17 00:00:00 2001 From: Sami Ahmed Date: Sat, 1 Aug 2026 13:42:52 -0700 Subject: [PATCH] fix(build): correct -mno-avx512* flag spelling GCC rejects -mno-avx512-4fmaps / -mno-avx512-4vnniw with the dash. The correct form is -mno-avx5124fmaps / -mno-avx5124vnniw (no dash between 'avx512' and the sub-feature name). v6.2.0-rc1 failed in CI with 'unrecognized command-line option' on these two flags; this fixes the spelling. --- cmake/AddCompilerFlags.cmake | 8 ++++++-- references/avx-512-sigill-build-fix.md | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cmake/AddCompilerFlags.cmake b/cmake/AddCompilerFlags.cmake index d34df72..40b5185 100644 --- a/cmake/AddCompilerFlags.cmake +++ b/cmake/AddCompilerFlags.cmake @@ -88,13 +88,17 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|AMD64)$" AND NOT WIN32 AND NOT # future-proof against the next GCC version autovectorizing # beyond AVX-512. See references/avx-512-sigill-build-fix.md # for the full diagnosis recipe. + # NB: -mno-avx512*4fmaps / -mno-avx512*4vnniw use NO dash between + # 'avx512' and the sub-feature (correct: -mno-avx5124fmaps). The + # -mno-avx512-4fmaps form (with a dash) is rejected by GCC and + # makes the whole build fail with "unrecognized command-line option". 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 + -mno-avx512bitalg -mno-avx512vpopcntdq + -mno-avx5124fmaps -mno-avx5124vnniw -mno-avx512vp2intersect ) endif() endif() diff --git a/references/avx-512-sigill-build-fix.md b/references/avx-512-sigill-build-fix.md index f01a6ba..b1722d3 100644 --- a/references/avx-512-sigill-build-fix.md +++ b/references/avx-512-sigill-build-fix.md @@ -101,13 +101,17 @@ if(CMAKE_X86_64_BASELINE) # the whole AVX-512 family so a CI runner's EPYC 7763 (or any # AVX-512-capable build host) cannot leak AVX-512 into a binary # that needs to run on KVM EPYC, Ryzen 3000, or ARM64. + # NB: -mno-avx512*4fmaps / -mno-avx512*4vnniw use NO dash between + # 'avx512' and the sub-feature (correct: -mno-avx5124fmaps). The + # -mno-avx512-4fmaps form (with a dash) is rejected by GCC and + # makes the whole build fail with "unrecognized command-line option". 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 + -mno-avx512bitalg -mno-avx512vpopcntdq + -mno-avx5124fmaps -mno-avx5124vnniw -mno-avx512vp2intersect ) endif() endif()