Skip to content

Commit 83b9d14

Browse files
JohnnyFFMclaude
andcommitted
build: stop leaking AVX/AVX2 codegen into scalar/SSE2 TUs
batch_validation.cpp and plot_generation.cpp contain no SIMD intrinsics — they only call into shabal256_avx2/sse2 via ordinary function calls. The set_property(SOURCE ... COMPILE_OPTIONS ${AVX2_CXXFLAGS}) blocks therefore served no purpose and let the compiler emit AVX/AVX2 anywhere in those TUs (memset/memcpy expansion to YMM, VEX-encoded SSE, auto-vectorization). The result was SIGILL on non-AVX2 x86-64 CPUs before the runtime HaveAVX2() gate could fire. Drop the three set_property blocks; keep target_compile_definitions ENABLE_AVX2, which is just a #define and has no codegen impact. The intrinsics-bearing TUs (shabal256_avx2.cpp, sha256_avx2.cpp) keep their flags via src/crypto/CMakeLists.txt and are unaffected. Fixes PoC-Consortium/bitcoin-pocx#1. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e06a6fc commit 83b9d14

2 files changed

Lines changed: 0 additions & 12 deletions

File tree

src/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,6 @@ target_link_libraries(bitcoin_consensus
9090
# Enable AVX2 for PoCX batch validation if available
9191
if(ENABLE_POCX AND HAVE_AVX2)
9292
target_compile_definitions(bitcoin_consensus PRIVATE ENABLE_AVX2)
93-
set_property(SOURCE pocx/consensus/batch_validation.cpp PROPERTY
94-
COMPILE_OPTIONS ${AVX2_CXXFLAGS}
95-
)
96-
set_property(SOURCE pocx/algorithms/plot_generation.cpp PROPERTY
97-
COMPILE_OPTIONS ${AVX2_CXXFLAGS}
98-
)
9993
endif()
10094
# SSE2 is baseline on x86-64, no special compiler flags needed
10195
if(ENABLE_POCX AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64")

src/kernel/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,6 @@ endif()
116116
# Enable AVX2 for PoCX batch validation if available
117117
if(ENABLE_POCX AND HAVE_AVX2)
118118
target_compile_definitions(bitcoinkernel PRIVATE ENABLE_AVX2)
119-
set_property(SOURCE ../pocx/consensus/batch_validation.cpp PROPERTY
120-
COMPILE_OPTIONS ${AVX2_CXXFLAGS}
121-
)
122-
set_property(SOURCE ../pocx/algorithms/plot_generation.cpp PROPERTY
123-
COMPILE_OPTIONS ${AVX2_CXXFLAGS}
124-
)
125119
endif()
126120
# SSE2 is baseline on x86-64, no special compiler flags needed
127121
if(ENABLE_POCX AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64")

0 commit comments

Comments
 (0)