Let the user have the final say in regards to using intrinsics.
As outlined in #13758, on master:
0./autogen.sh
1./configure CXXFLAGS="-mno-avx -mno-avx2"
2…
3checking whether C++ compiler accepts -mavx -mavx2... yes
4checking for AVX2 intrinsics... yes
5…
6make
7…
8crypto/sha256_avx2.cpp: In function ‘__m256i sha256d64_avx2::{anonymous}::K(uint32_t)’:
9crypto/sha256_avx2.cpp:15:28: warning: AVX vector return without AVX enabled changes the ABI [-Wpsabi]
10 15 | __m256i inline K(uint32_t x) { return _mm256_set1_epi32(x); }
11 | ^
12crypto/sha256_avx2.cpp: In function ‘__m256i sha256d64_avx2::{anonymous}::Inc(__m256i&, __m256i)’:
13crypto/sha256_avx2.cpp:21:16: note: the ABI for passing parameters with 32-byte alignment has changed in GCC 4.6
14 21 | __m256i inline Inc(__m256i& x, __m256i y) { x = Add(x, y); return x; }
15 | ^~~
16In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:43,
17 from crypto/sha256_avx2.cpp:8:
18/usr/lib/gcc/x86_64-linux-gnu/11/include/avxintrin.h: In function ‘__m256i sha256d64_avx2::{anonymous}::K(uint32_t)’:
19/usr/lib/gcc/x86_64-linux-gnu/11/include/avxintrin.h:1326:1: error: inlining failed in call to ‘always_inline’ ‘__m256i _mm256_set1_epi32(int)’: target specific option mismatch
201326 | _mm256_set1_epi32 (int __A)
21 | ^~~~~~~~~~~~~~~~~
22crypto/sha256_avx2.cpp:15:56: note: called from here
23 15 | __m256i inline K(uint32_t x) { return _mm256_set1_epi32(x); }
24 | ~~~~~~~~~~~~~~~~~^~~
25make[2]: *** [Makefile:13455: crypto/libbitcoin_crypto_avx2_la-sha256_avx2.lo] Error 1
with this branch:
0./autogen.sh
1./configure CXXFLAGS="-mno-avx -mno-avx2"
2…
3checking whether C++ compiler accepts -mavx -mavx2... yes
4checking for AVX2 intrinsics... no
5…
6make check
Fixes: #13758 Alternative to #13789, which should work for all compilers.
Guix Build (x86_64):
01fe67be2fe83c79d3b01c1cd657bed09e573226bf283e335d052c65c08a8e085 guix-build-4349051dd474/output/aarch64-linux-gnu/SHA256SUMS.part
192904614f8792595c30c38c8aadfcd64ded658d58146dbae529c7b66e975d72e guix-build-4349051dd474/output/aarch64-linux-gnu/bitcoin-4349051dd474-aarch64-linux-gnu-debug.tar.gz
20e6c1d12caf87d9359d42eea4b652f10e69ab15a18bd572214f22046b2a019f1 guix-build-4349051dd474/output/aarch64-linux-gnu/bitcoin-4349051dd474-aarch64-linux-gnu.tar.gz
3e1b7d9b65cf0233c13affd570a0b3247c806553d968188a79f87ce9aab4fee36 guix-build-4349051dd474/output/arm-linux-gnueabihf/SHA256SUMS.part
4a7e0e53c2b6a0d0dc47a0740e501b280f82640e43d59e43d24dc236e9e9d3b4e guix-build-4349051dd474/output/arm-linux-gnueabihf/bitcoin-4349051dd474-arm-linux-gnueabihf-debug.tar.gz
51969980159033d1c9f73e199acb9f93ddbbbd1565ac717ac5a29b907b46aec9c guix-build-4349051dd474/output/arm-linux-gnueabihf/bitcoin-4349051dd474-arm-linux-gnueabihf.tar.gz
6a1d679c8a861dc7b0422505e172745157680392227724bdbb6efb83ab564dd61 guix-build-4349051dd474/output/arm64-apple-darwin/SHA256SUMS.part
737441242a3b97e51087a1b5df953f0a3ecb57a9523713bae152ac8005427118a guix-build-4349051dd474/output/arm64-apple-darwin/bitcoin-4349051dd474-arm64-apple-darwin-unsigned.dmg
8e86757e6f4b92080ed6504c245787d801a8f3ade07e1ed4cb0d1fa7a0088430e guix-build-4349051dd474/output/arm64-apple-darwin/bitcoin-4349051dd474-arm64-apple-darwin-unsigned.tar.gz
9ba2405f0b4835a3cb82bba4b281f6ffef97eb402430b47588c7ac986a29c5ae3 guix-build-4349051dd474/output/arm64-apple-darwin/bitcoin-4349051dd474-arm64-apple-darwin.tar.gz
107a4675924f23b9a57c93077d4a00a3d87a3929269301f70709079ee2491d932a guix-build-4349051dd474/output/dist-archive/bitcoin-4349051dd474.tar.gz
114f45b1cd6a819fd1f0fe81ef2c3f3bbb6614c9cbeb2115bfd15ef0f8fb50da25 guix-build-4349051dd474/output/powerpc64-linux-gnu/SHA256SUMS.part
12262db5ffba4d952e0b3eb2a4f97a795058d58dbd280c48e7a389809c699c7465 guix-build-4349051dd474/output/powerpc64-linux-gnu/bitcoin-4349051dd474-powerpc64-linux-gnu-debug.tar.gz
130a230d352da964fb8bd101aa690a49604ecbfaf1756c8da9aad88635598b0102 guix-build-4349051dd474/output/powerpc64-linux-gnu/bitcoin-4349051dd474-powerpc64-linux-gnu.tar.gz
14f155e0039b78bf772db8047b5d9eb4445e30b210f1bfa1d184e5587a06cdc583 guix-build-4349051dd474/output/powerpc64le-linux-gnu/SHA256SUMS.part
156c32c429f5555cd5bab34a201352a3dae335f4bc23607996e170691c403db68f guix-build-4349051dd474/output/powerpc64le-linux-gnu/bitcoin-4349051dd474-powerpc64le-linux-gnu-debug.tar.gz
160c0d4d37eb75a04a702e1c7116fa89fd5d03439a0c08fdbcbc2d5349e071037e guix-build-4349051dd474/output/powerpc64le-linux-gnu/bitcoin-4349051dd474-powerpc64le-linux-gnu.tar.gz
17bcc72b010ef0d53811d5b21e8b65a45ec861b0dc4658286c85b4eea3c5ef3264 guix-build-4349051dd474/output/riscv64-linux-gnu/SHA256SUMS.part
18c9740aa9daac4a57361b563525bd273851bc607544cfa196260f715794ebbc4b guix-build-4349051dd474/output/riscv64-linux-gnu/bitcoin-4349051dd474-riscv64-linux-gnu-debug.tar.gz
19049b1d9ef133fd5901bdbe1e77c5f11c43da4f3f8fca133c0be1dbfcddb6e900 guix-build-4349051dd474/output/riscv64-linux-gnu/bitcoin-4349051dd474-riscv64-linux-gnu.tar.gz
206d2ff63af68d5c6dd5709b3543e0ed59d2b6cd9c3b4f20fa873edb5a643ad929 guix-build-4349051dd474/output/x86_64-apple-darwin/SHA256SUMS.part
216dc850bed29860fc23b183ddf9bcf17c6e6ad3917a220c13d617a3bcd16b5788 guix-build-4349051dd474/output/x86_64-apple-darwin/bitcoin-4349051dd474-x86_64-apple-darwin-unsigned.dmg
222ff9849c2cf8504e1bbedc5bdc2bb1a11f439df84a6c2cfcbf195025c11289e8 guix-build-4349051dd474/output/x86_64-apple-darwin/bitcoin-4349051dd474-x86_64-apple-darwin-unsigned.tar.gz
234d284659d6df5d3ead86d313fb5794552a83102f5c30fa433f32c87a2be25679 guix-build-4349051dd474/output/x86_64-apple-darwin/bitcoin-4349051dd474-x86_64-apple-darwin.tar.gz
24029b5dacfe77e865263fe3f9f0c12d65bf0fcfed152812e50cabd085a4a12b14 guix-build-4349051dd474/output/x86_64-linux-gnu/SHA256SUMS.part
253f8295482e9da6e5a3780a98ef9e58b0924f59f9e2ab76bc70e1dc9c8691a764 guix-build-4349051dd474/output/x86_64-linux-gnu/bitcoin-4349051dd474-x86_64-linux-gnu-debug.tar.gz
269dd5bb321c4bae36cfd8b6b23dd3df9462917c272bd36a7f562131db3a067d35 guix-build-4349051dd474/output/x86_64-linux-gnu/bitcoin-4349051dd474-x86_64-linux-gnu.tar.gz
27632ad4f8d7c10f4eb8422e0ccb1ecf35c03260fe1eb91224b0ab3d18765960b7 guix-build-4349051dd474/output/x86_64-w64-mingw32/SHA256SUMS.part
28fb6609c3f74b676a67d2334c150094a1be5f5d6a41ae40edcb26b073ce3ad841 guix-build-4349051dd474/output/x86_64-w64-mingw32/bitcoin-4349051dd474-win64-debug.zip
29706074270e189a6e9bd32e1b522fc0c5c9f3c076839db9cc983d171bb2f2dd4a guix-build-4349051dd474/output/x86_64-w64-mingw32/bitcoin-4349051dd474-win64-setup-unsigned.exe
3078ce8c104eb6496f76633c5ee3988965b8b687583c51d97957cf936e34e8c6ef guix-build-4349051dd474/output/x86_64-w64-mingw32/bitcoin-4349051dd474-win64-unsigned.tar.gz
310db748e76cb4d414f81f8b538e4b0a79ab1281fb16e480fcada9935e2bfc709d guix-build-4349051dd474/output/x86_64-w64-mingw32/bitcoin-4349051dd474-win64.zip
Guix Build (arm64):
0e1b7d9b65cf0233c13affd570a0b3247c806553d968188a79f87ce9aab4fee36 guix-build-4349051dd474/output/arm-linux-gnueabihf/SHA256SUMS.part
1a7e0e53c2b6a0d0dc47a0740e501b280f82640e43d59e43d24dc236e9e9d3b4e guix-build-4349051dd474/output/arm-linux-gnueabihf/bitcoin-4349051dd474-arm-linux-gnueabihf-debug.tar.gz
21969980159033d1c9f73e199acb9f93ddbbbd1565ac717ac5a29b907b46aec9c guix-build-4349051dd474/output/arm-linux-gnueabihf/bitcoin-4349051dd474-arm-linux-gnueabihf.tar.gz
3a1d679c8a861dc7b0422505e172745157680392227724bdbb6efb83ab564dd61 guix-build-4349051dd474/output/arm64-apple-darwin/SHA256SUMS.part
437441242a3b97e51087a1b5df953f0a3ecb57a9523713bae152ac8005427118a guix-build-4349051dd474/output/arm64-apple-darwin/bitcoin-4349051dd474-arm64-apple-darwin-unsigned.dmg
5e86757e6f4b92080ed6504c245787d801a8f3ade07e1ed4cb0d1fa7a0088430e guix-build-4349051dd474/output/arm64-apple-darwin/bitcoin-4349051dd474-arm64-apple-darwin-unsigned.tar.gz
6ba2405f0b4835a3cb82bba4b281f6ffef97eb402430b47588c7ac986a29c5ae3 guix-build-4349051dd474/output/arm64-apple-darwin/bitcoin-4349051dd474-arm64-apple-darwin.tar.gz
77a4675924f23b9a57c93077d4a00a3d87a3929269301f70709079ee2491d932a guix-build-4349051dd474/output/dist-archive/bitcoin-4349051dd474.tar.gz
84f45b1cd6a819fd1f0fe81ef2c3f3bbb6614c9cbeb2115bfd15ef0f8fb50da25 guix-build-4349051dd474/output/powerpc64-linux-gnu/SHA256SUMS.part
9262db5ffba4d952e0b3eb2a4f97a795058d58dbd280c48e7a389809c699c7465 guix-build-4349051dd474/output/powerpc64-linux-gnu/bitcoin-4349051dd474-powerpc64-linux-gnu-debug.tar.gz
100a230d352da964fb8bd101aa690a49604ecbfaf1756c8da9aad88635598b0102 guix-build-4349051dd474/output/powerpc64-linux-gnu/bitcoin-4349051dd474-powerpc64-linux-gnu.tar.gz
11f155e0039b78bf772db8047b5d9eb4445e30b210f1bfa1d184e5587a06cdc583 guix-build-4349051dd474/output/powerpc64le-linux-gnu/SHA256SUMS.part
126c32c429f5555cd5bab34a201352a3dae335f4bc23607996e170691c403db68f guix-build-4349051dd474/output/powerpc64le-linux-gnu/bitcoin-4349051dd474-powerpc64le-linux-gnu-debug.tar.gz
130c0d4d37eb75a04a702e1c7116fa89fd5d03439a0c08fdbcbc2d5349e071037e guix-build-4349051dd474/output/powerpc64le-linux-gnu/bitcoin-4349051dd474-powerpc64le-linux-gnu.tar.gz
14bcc72b010ef0d53811d5b21e8b65a45ec861b0dc4658286c85b4eea3c5ef3264 guix-build-4349051dd474/output/riscv64-linux-gnu/SHA256SUMS.part
15c9740aa9daac4a57361b563525bd273851bc607544cfa196260f715794ebbc4b guix-build-4349051dd474/output/riscv64-linux-gnu/bitcoin-4349051dd474-riscv64-linux-gnu-debug.tar.gz
16049b1d9ef133fd5901bdbe1e77c5f11c43da4f3f8fca133c0be1dbfcddb6e900 guix-build-4349051dd474/output/riscv64-linux-gnu/bitcoin-4349051dd474-riscv64-linux-gnu.tar.gz
176d2ff63af68d5c6dd5709b3543e0ed59d2b6cd9c3b4f20fa873edb5a643ad929 guix-build-4349051dd474/output/x86_64-apple-darwin/SHA256SUMS.part
186dc850bed29860fc23b183ddf9bcf17c6e6ad3917a220c13d617a3bcd16b5788 guix-build-4349051dd474/output/x86_64-apple-darwin/bitcoin-4349051dd474-x86_64-apple-darwin-unsigned.dmg
192ff9849c2cf8504e1bbedc5bdc2bb1a11f439df84a6c2cfcbf195025c11289e8 guix-build-4349051dd474/output/x86_64-apple-darwin/bitcoin-4349051dd474-x86_64-apple-darwin-unsigned.tar.gz
204d284659d6df5d3ead86d313fb5794552a83102f5c30fa433f32c87a2be25679 guix-build-4349051dd474/output/x86_64-apple-darwin/bitcoin-4349051dd474-x86_64-apple-darwin.tar.gz
21029b5dacfe77e865263fe3f9f0c12d65bf0fcfed152812e50cabd085a4a12b14 guix-build-4349051dd474/output/x86_64-linux-gnu/SHA256SUMS.part
223f8295482e9da6e5a3780a98ef9e58b0924f59f9e2ab76bc70e1dc9c8691a764 guix-build-4349051dd474/output/x86_64-linux-gnu/bitcoin-4349051dd474-x86_64-linux-gnu-debug.tar.gz
239dd5bb321c4bae36cfd8b6b23dd3df9462917c272bd36a7f562131db3a067d35 guix-build-4349051dd474/output/x86_64-linux-gnu/bitcoin-4349051dd474-x86_64-linux-gnu.tar.gz
24632ad4f8d7c10f4eb8422e0ccb1ecf35c03260fe1eb91224b0ab3d18765960b7 guix-build-4349051dd474/output/x86_64-w64-mingw32/SHA256SUMS.part
25fb6609c3f74b676a67d2334c150094a1be5f5d6a41ae40edcb26b073ce3ad841 guix-build-4349051dd474/output/x86_64-w64-mingw32/bitcoin-4349051dd474-win64-debug.zip
26706074270e189a6e9bd32e1b522fc0c5c9f3c076839db9cc983d171bb2f2dd4a guix-build-4349051dd474/output/x86_64-w64-mingw32/bitcoin-4349051dd474-win64-setup-unsigned.exe
2778ce8c104eb6496f76633c5ee3988965b8b687583c51d97957cf936e34e8c6ef guix-build-4349051dd474/output/x86_64-w64-mingw32/bitcoin-4349051dd474-win64-unsigned.tar.gz
280db748e76cb4d414f81f8b538e4b0a79ab1281fb16e480fcada9935e2bfc709d guix-build-4349051dd474/output/x86_64-w64-mingw32/bitcoin-4349051dd474-win64.zip