Skip to content

Commit d5fc8bf

Browse files
2bb8e5b chore: resolve nit from review (Kittywhiskers Van Gogh) 61bba13 fix: tweak bls/bls_dkg benchmarks to work faster in `-sanity-check` mode (UdjinM6) 0eff28c merge bitcoin#29834: Change MAC_OSX macro to __APPLE__ in crypto (Kittywhiskers Van Gogh) 76cef17 merge bitcoin#28893: Fix SSE4.1-related issues (Kittywhiskers Van Gogh) 16209a8 merge bitcoin#29528: move sha256_sse4 into libbitcoin_crypto_base (Kittywhiskers Van Gogh) ec1f492 merge bitcoin#29407: remove confusing and inconsistent disable-asm option (Kittywhiskers Van Gogh) 9440c18 merge bitcoin#29180: remove use of BUILD_BITCOIN_INTERNAL macro in sha256 (Kittywhiskers Van Gogh) 68f6bea fix: place `LIBTEST_*` before `LIBBITCOIN_*` for fuzzing binaries (Kittywhiskers Van Gogh) a3c11b6 partial bitcoin#24322: Introduce initial `libbitcoinkernel` (Kittywhiskers Van Gogh) 9f981dd merge bitcoin#27598: Add SHA256 implementation specific benchmarks (Kittywhiskers Van Gogh) 306fa9a chore: realign function names in `crypto_hash` bench with upstream (Kittywhiskers Van Gogh) 3bdc15a chore: replace leftover `minEpochIterations` from `crypto_hash` benches (Kittywhiskers Van Gogh) f300277 chore: drop `minEpochIterations(10)` from `crypto_hash` bench functions (Kittywhiskers Van Gogh) c8f0d54 chore: move Dash-specific tests downward, sort like upstream (Kittywhiskers Van Gogh) fda951f merge bitcoin#26481: Suppress output when running with `-sanity-check` option (Kittywhiskers Van Gogh) a5718a0 partial bitcoin#25200: Fix spelling errors identified by codespell in comments (Kittywhiskers Van Gogh) 58a6248 partial bitcoin#26158: add "priority level" to the benchmark framework (Kittywhiskers Van Gogh) 160b3fc merge bitcoin#25107: Add `--sanity-check` flag, use it in `make check` (Kittywhiskers Van Gogh) 2ad60b3 fix: use atomic in `BLS_Verify_BatchedParallel` to avoid data race (Kittywhiskers Van Gogh) 24ad076 fix: ensure that globals are set and checks present to avoid bench errs (Kittywhiskers Van Gogh) 1c54997 trivial: re-enable benchmarks for `make check` (Kittywhiskers Van Gogh) 2a0df15 merge bitcoin#25058: Move output script RPCs to separate file, rename misc.cpp (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * `make check` upstream includes a dry run of the benchmarking suite, this behavior was introduced in [bitcoin#14092](bitcoin#14092) (a557022) but was disabled for Dash Core as our benchmarking suite is substantially heavier. Unfortunately, as a side effect of that, failures in the benchmark suite go unnoticed by CI (see e507a51 for one such fix). With the introduction of [bitcoin#25107](bitcoin#25107) and [bitcoin#26158](bitcoin#26158), the sanity checks require significantly less overhead and should be suitable for reintroduction into the `make check` rotation. * The sanity check caught failures in the test suite ([build](https://github.com/dashpay/dash/actions/runs/16291896463/job/46003746200#step:10:206)) due to missing initialization or insufficient checking and they have been remedied in this pull request. An example is available below. <details> <summary>Debugger stacktrace</summary> ``` #0 StatsdClient::send<unsigned long> (this=0x0, key="CheckBlock_us", value=2847, type="ms", sample_rate=1) at stats/client.cpp:108 #1 0x0000555555c3603f in StatsdClient::timing (this=0x0, key="CheckBlock_us", ms=2847, sample_rate=1) at stats/client.cpp:100 #2 0x0000555555ca0b51 in CheckBlock (block=..., state=..., consensusParams=..., fCheckPOW=true, fCheckMerkleRoot=true) at validation.cpp:3932 #3 0x000055555560cca5 in DeserializeAndCheckBlockTest(ankerl::nanobench::Bench&)::$_0::operator()() const (this=0x7fffffffd120) at bench/checkblock.cpp:47 #4 ankerl::nanobench::Bench::run<DeserializeAndCheckBlockTest(ankerl::nanobench::Bench&)::$_0>(DeserializeAndCheckBlockTest(ankerl::nanobench::Bench&)::$_0&&) (this=0x7fffffffd430, op=...) at ./bench/nanobench.h:1221 #5 0x000055555560c74b in DeserializeAndCheckBlockTest (bench=...) at bench/checkblock.cpp:40 #6 0x00005555555e2f4a in std::function<void (ankerl::nanobench::Bench&)>::operator()(ankerl::nanobench::Bench&) const (this=0x555556942a90, __args=...) at /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/std_function.h:591 #7 benchmark::BenchRunner::RunAll (args=...) at bench/bench.cpp:120 #8 0x00005555555de5f4 in main (argc=<optimized out>, argv=<optimized out>) at bench/bench_bitcoin.cpp:134 ``` </details> * The benchmark `BLS_Verify_BatchedParallel` also has a data race that was spotted courtesy of `make check` ([build](https://github.com/dashpay/dash/actions/runs/16295305205/job/46015360773#step:10:183)) that has been resolved by using an atomic. * To allow backporting [bitcoin#27598](bitcoin#27598), the naming scheme changes in `src/bench/crypto_hash.cpp` introduced by [dash#1925](#1925) have been effectively reverted and Dash-specific benchmarks have been moved downward to mitigate merge conflict issues. * Similarly, changes to minimum iteration and batching by input size were made to realign with upstream. * The order of libraries for the linker had to be rearranged as the linker reads dependencies from left to right (i.e. top to bottom), which makes them ordering sensitive. Without this, the linker complains visibly (see below). <details> <summary>Linker errors:</summary> ``` $ make -j10 [...] AR libbitcoin_node.a CXXLD dashd CXXLD test/test_dash CXXLD qt/dash-qt CXXLD test/fuzz/fuzz CXXLD qt/test/test_dash-qt CXXLD bench/bench_dash /usr/bin/ld: libtest_util.a(libtest_util_a-setup_common.o): in function `DashChainstateSetup(ChainstateManager&, node::NodeContext&, bool, bool, Consensus::Params const&)': /src/dash/dash/src/test/util/setup_common.cpp:128: undefined reference to `node::DashChainstateSetup(ChainstateManager&, CGovernanceManager&, CMasternodeMetaMan&, CMasternodeSync&, CSporkManager&, std::unique_ptr<CActiveMasternodeManager, std::default_delete<CActiveMasternodeManager> >&, std::unique_ptr<CChainstateHelper, std::default_delete<CChainstateHelper> >&, std::unique_ptr<CCreditPoolManager, std::default_delete<CCreditPoolManager> >&, std::unique_ptr<CDeterministicMNManager, std::default_delete<CDeterministicMNManager> >&, std::unique_ptr<CEvoDB, std::default_delete<CEvoDB> >&, std::unique_ptr<CMNHFManager, std::default_delete<CMNHFManager> >&, std::unique_ptr<LLMQContext, std::default_delete<LLMQContext> >&, CTxMemPool*, bool, bool, Consensus::Params const&)' /usr/bin/ld: libtest_util.a(libtest_util_a-setup_common.o): in function `DashChainstateSetupClose(node::NodeContext&)': /src/dash/dash/src/test/util/setup_common.cpp:136: undefined reference to `node::DashChainstateSetupClose(std::unique_ptr<CChainstateHelper, std::default_delete<CChainstateHelper> >&, std::unique_ptr<CCreditPoolManager, std::default_delete<CCreditPoolManager> >&, std::unique_ptr<CDeterministicMNManager, std::default_delete<CDeterministicMNManager> >&, std::unique_ptr<CMNHFManager, std::default_delete<CMNHFManager> >&, std::unique_ptr<LLMQContext, std::default_delete<LLMQContext> >&, CTxMemPool*)' /usr/bin/ld: libtest_util.a(libtest_util_a-setup_common.o): in function `BasicTestingSetup::BasicTestingSetup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<char const*, std::allocator<char const*> > const&)': [...] clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [Makefile:7723: test/fuzz/fuzz] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory '/src/dash/dash/src' make[1]: *** [Makefile:20430: all-recursive] Error 1 make[1]: Leaving directory '/src/dash/dash/src' make: *** [Makefile:796: all-recursive] Error 1 ``` </details> ## Breaking Changes None expected. ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)** - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: PastaPastaPasta: utACK 2bb8e5b Tree-SHA512: 1771f6af9d7a4da9f5417dc60fa0a69f7f1adb1c366ab458d9c2d572c2924ac03fd2c4b9e00cda8a63022cbc193b6b262349c5eab79654a1d0006e5e65327340
2 parents 4c26ed8 + 2bb8e5b commit d5fc8bf

28 files changed

+1003
-724
lines changed

configure.ac

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,6 @@ AC_ARG_ENABLE([threadlocal],
242242
[use_thread_local=$enableval],
243243
[use_thread_local=auto])
244244

245-
AC_ARG_ENABLE([asm],
246-
[AS_HELP_STRING([--disable-asm],
247-
[disable assembly routines (enabled by default)])],
248-
[use_asm=$enableval],
249-
[use_asm=yes])
250-
251-
if test "$use_asm" = "yes"; then
252-
AC_DEFINE([USE_ASM], [1], [Define this symbol to build in assembly routines])
253-
fi
254-
255245
AC_ARG_ENABLE([zmq],
256246
[AS_HELP_STRING([--disable-zmq],
257247
[disable ZMQ notifications])],
@@ -556,8 +546,6 @@ enable_sse41=no
556546
enable_avx2=no
557547
enable_x86_shani=no
558548

559-
if test "$use_asm" = "yes"; then
560-
561549
dnl Check for optional instruction set support. Enabling these does _not_ imply that all code will
562550
dnl be compiled with them, rather that specific objects/libs may use them after checking for runtime
563551
dnl compatibility.
@@ -612,11 +600,12 @@ TEMP_CXXFLAGS="$CXXFLAGS"
612600
CXXFLAGS="$SSE41_CXXFLAGS $CXXFLAGS"
613601
AC_MSG_CHECKING([for SSE4.1 intrinsics])
614602
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
615-
#include <stdint.h>
616603
#include <immintrin.h>
617604
]],[[
618-
__m128i l = _mm_set1_epi32(0);
619-
return _mm_extract_epi32(l, 3);
605+
__m128i a = _mm_set1_epi32(0);
606+
__m128i b = _mm_set1_epi32(1);
607+
__m128i r = _mm_blend_epi16(a, b, 0xFF);
608+
return _mm_extract_epi32(r, 3);
620609
]])],
621610
[ AC_MSG_RESULT([yes]); enable_sse41=yes; AC_DEFINE([ENABLE_SSE41], [1], [Define this symbol to build code that uses SSE4.1 intrinsics]) ],
622611
[ AC_MSG_RESULT([no])]
@@ -696,8 +685,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
696685
)
697686
CXXFLAGS="$TEMP_CXXFLAGS"
698687

699-
fi
700-
701688
CORE_CPPFLAGS="$CORE_CPPFLAGS -DHAVE_BUILD_INFO -DGSL_NO_IOSTREAMS"
702689

703690
AC_ARG_WITH([utils],
@@ -1843,7 +1830,6 @@ AM_CONDITIONAL([ENABLE_AVX2], [test "$enable_avx2" = "yes"])
18431830
AM_CONDITIONAL([ENABLE_X86_SHANI], [test "$enable_x86_shani" = "yes"])
18441831
AM_CONDITIONAL([ENABLE_ARM_CRC], [test "$enable_arm_crc" = "yes"])
18451832
AM_CONDITIONAL([ENABLE_ARM_SHANI], [test "$enable_arm_shani" = "yes"])
1846-
AM_CONDITIONAL([USE_ASM], [test "$use_asm" = "yes"])
18471833
AM_CONDITIONAL([WORDS_BIGENDIAN], [test "$ac_cv_c_bigendian" = "yes"])
18481834
AM_CONDITIONAL([USE_NATPMP], [test "$use_natpmp" = "yes"])
18491835
AM_CONDITIONAL([USE_UPNP], [test "$use_upnp" = "yes"])
@@ -1988,7 +1974,6 @@ echo " with fuzz binary = $enable_fuzz_binary"
19881974
echo " with bench = $use_bench"
19891975
echo " with upnp = $use_upnp"
19901976
echo " with natpmp = $use_natpmp"
1991-
echo " use asm = $use_asm"
19921977
echo " USDT tracing = $use_usdt"
19931978
echo " sanitizers = $use_sanitizers"
19941979
echo " debug enabled = $enable_debug"

doc/developer-notes.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -569,13 +569,6 @@ export UBSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/ubsan:prin
569569
See the CI config for more examples, and upstream documentation for more information
570570
about any additional options.
571571

572-
There are a number of known problems when using the `address` sanitizer. The
573-
address sanitizer is known to fail in
574-
[sha256_sse4::Transform](/src/crypto/sha256_sse4.cpp) which makes it unusable
575-
unless you also use `--disable-asm` when running configure. We would like to fix
576-
sanitizer issues, so please send pull requests if you can fix any errors found
577-
by the address sanitizer (or any other sanitizer).
578-
579572
Not all sanitizer options can be enabled at the same time, e.g. trying to build
580573
with `--with-sanitizers=address,thread` will fail in the configure script as
581574
these sanitizers are mutually incompatible. Refer to your compiler manual to

doc/fuzzing.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,14 @@ The default Clang/LLVM version supplied by Apple on macOS does not include
127127
fuzzing libraries, so macOS users will need to install a full version, for
128128
example using `brew install llvm`.
129129
130-
Should you run into problems with the address sanitizer, it is possible you
131-
may need to run `./configure` with `--disable-asm` to avoid errors
132-
with certain assembly code from Dash Core's code. See [developer notes on sanitizers](https://github.com/dashpay/dash/blob/develop/doc/developer-notes.md#sanitizers)
133-
for more information.
134-
135130
You may also need to take care of giving the correct path for `clang` and
136131
`clang++`, like `CC=/path/to/clang CXX=/path/to/clang++` if the non-systems
137132
`clang` does not come first in your path.
138133
139134
Full configure that was tested on macOS with `brew` installed `llvm`:
140135
141136
```sh
142-
./configure --enable-fuzz --with-sanitizers=fuzzer,address,undefined --disable-asm CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++
137+
./configure --enable-fuzz --with-sanitizers=fuzzer,address,undefined CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++
143138
```
144139
145140
Read the [libFuzzer documentation](https://llvm.org/docs/LibFuzzer.html) for more information. This [libFuzzer tutorial](https://github.com/google/fuzzing/blob/master/tutorial/libFuzzerTutorial.md) might also be of interest.

src/Makefile.am

Lines changed: 73 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ AM_LIBTOOLFLAGS = --preserve-dup-deps
1818
PTHREAD_FLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
1919
EXTRA_LIBRARIES =
2020

21+
lib_LTLIBRARIES = $(LIBBITCOINCONSENSUS)
22+
noinst_LTLIBRARIES =
23+
24+
bin_PROGRAMS =
25+
noinst_PROGRAMS =
26+
check_PROGRAMS =
27+
TESTS =
28+
BENCHMARKS =
29+
2130
if ENABLE_STACKTRACES
2231
if ENABLE_CRASH_HOOKS
2332
if CRASH_HOOKS_WRAPPED_CXX_ABI
@@ -47,7 +56,7 @@ LIBBITCOIN_COMMON=libbitcoin_common.a
4756
LIBBITCOIN_CONSENSUS=libbitcoin_consensus.a
4857
LIBBITCOIN_CLI=libbitcoin_cli.a
4958
LIBBITCOIN_UTIL=libbitcoin_util.a
50-
LIBBITCOIN_CRYPTO_BASE=crypto/libbitcoin_crypto_base.a
59+
LIBBITCOIN_CRYPTO_BASE=crypto/libbitcoin_crypto_base.la
5160
LIBBITCOINQT=qt/libbitcoinqt.a
5261
LIBDASHBLS=dashbls/libdashbls.la
5362
LIBSECP256K1=secp256k1/libsecp256k1.la
@@ -63,23 +72,24 @@ LIBBITCOIN_WALLET=libbitcoin_wallet.a
6372
LIBBITCOIN_WALLET_TOOL=libbitcoin_wallet_tool.a
6473
endif
6574

66-
LIBBITCOIN_CRYPTO= $(LIBBITCOIN_CRYPTO_BASE)
75+
LIBBITCOIN_CRYPTO = $(LIBBITCOIN_CRYPTO_BASE)
6776
if ENABLE_SSE41
68-
LIBBITCOIN_CRYPTO_SSE41 = crypto/libbitcoin_crypto_sse41.a
77+
LIBBITCOIN_CRYPTO_SSE41 = crypto/libbitcoin_crypto_sse41.la
6978
LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_SSE41)
79+
if ENABLE_X86_SHANI
80+
LIBBITCOIN_CRYPTO_X86_SHANI = crypto/libbitcoin_crypto_x86_shani.la
81+
LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_X86_SHANI)
82+
endif
7083
endif
7184
if ENABLE_AVX2
72-
LIBBITCOIN_CRYPTO_AVX2 = crypto/libbitcoin_crypto_avx2.a
85+
LIBBITCOIN_CRYPTO_AVX2 = crypto/libbitcoin_crypto_avx2.la
7386
LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_AVX2)
7487
endif
75-
if ENABLE_X86_SHANI
76-
LIBBITCOIN_CRYPTO_X86_SHANI = crypto/libbitcoin_crypto_x86_shani.a
77-
LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_X86_SHANI)
78-
endif
7988
if ENABLE_ARM_SHANI
80-
LIBBITCOIN_CRYPTO_ARM_SHANI = crypto/libbitcoin_crypto_arm_shani.a
89+
LIBBITCOIN_CRYPTO_ARM_SHANI = crypto/libbitcoin_crypto_arm_shani.la
8190
LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_ARM_SHANI)
8291
endif
92+
noinst_LTLIBRARIES += $(LIBBITCOIN_CRYPTO)
8393

8494
$(LIBDASHBLS):
8595
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D)
@@ -90,7 +100,6 @@ $(LIBSECP256K1): $(wildcard secp256k1/src/*.h) $(wildcard secp256k1/src/*.c) $(w
90100
# Make is not made aware of per-object dependencies to avoid limiting building parallelization
91101
# But to build the less dependent modules first, we manually select their order here:
92102
EXTRA_LIBRARIES += \
93-
$(LIBBITCOIN_CRYPTO) \
94103
$(LIBBITCOIN_UTIL) \
95104
$(LIBBITCOIN_COMMON) \
96105
$(LIBBITCOIN_CONSENSUS) \
@@ -101,15 +110,6 @@ EXTRA_LIBRARIES += \
101110
$(LIBBITCOIN_WALLET_TOOL) \
102111
$(LIBBITCOIN_ZMQ)
103112

104-
lib_LTLIBRARIES = $(LIBBITCOINCONSENSUS)
105-
noinst_LTLIBRARIES =
106-
107-
bin_PROGRAMS =
108-
noinst_PROGRAMS =
109-
check_PROGRAMS =
110-
TESTS =
111-
BENCHMARKS =
112-
113113
if BUILD_BITCOIND
114114
bin_PROGRAMS += dashd
115115
endif
@@ -546,8 +546,9 @@ libbitcoin_node_a_SOURCES = \
546546
rpc/mempool.cpp \
547547
rpc/governance.cpp \
548548
rpc/mining.cpp \
549-
rpc/misc.cpp \
549+
rpc/node.cpp \
550550
rpc/net.cpp \
551+
rpc/output_script.cpp \
551552
rpc/quorums.cpp \
552553
rpc/rawtransaction.cpp \
553554
rpc/server.cpp \
@@ -641,9 +642,20 @@ libbitcoin_wallet_tool_a_SOURCES = \
641642
$(BITCOIN_CORE_H)
642643

643644
# crypto primitives library
644-
crypto_libbitcoin_crypto_base_a_CPPFLAGS = $(AM_CPPFLAGS) $(PIC_FLAGS)
645-
crypto_libbitcoin_crypto_base_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) $(PIC_FLAGS)
646-
crypto_libbitcoin_crypto_base_a_SOURCES = \
645+
646+
# crypto_base contains the unspecialized (unoptimized) versions of our
647+
# crypto functions. Functions that require custom compiler flags and/or
648+
# runtime opt-in are omitted.
649+
crypto_libbitcoin_crypto_base_la_CPPFLAGS = $(AM_CPPFLAGS) $(PIC_FLAGS)
650+
651+
# Specify -static in both CXXFLAGS and LDFLAGS so libtool will only build a
652+
# static version of this library. We don't need a dynamic version, and a dynamic
653+
# version can't be used on windows anyway because the library doesn't currently
654+
# export DLL symbols.
655+
crypto_libbitcoin_crypto_base_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) $(PIC_FLAGS) -static
656+
crypto_libbitcoin_crypto_base_la_LDFLAGS = $(AM_LDFLAGS) -static
657+
658+
crypto_libbitcoin_crypto_base_la_SOURCES = \
647659
crypto/aes.cpp \
648660
crypto/aes.h \
649661
crypto/chacha20.h \
@@ -669,31 +681,34 @@ crypto_libbitcoin_crypto_base_a_SOURCES = \
669681
crypto/sha1.h \
670682
crypto/sha256.cpp \
671683
crypto/sha256.h \
684+
crypto/sha256_sse4.cpp \
672685
crypto/sha3.cpp \
673686
crypto/sha3.h \
674687
crypto/sha512.cpp \
675688
crypto/sha512.h \
676689
crypto/siphash.cpp \
677690
crypto/siphash.h
678691

679-
if USE_ASM
680-
crypto_libbitcoin_crypto_base_a_SOURCES += crypto/sha256_sse4.cpp
681-
endif
682-
683-
crypto_libbitcoin_crypto_sse41_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
684-
crypto_libbitcoin_crypto_sse41_a_CPPFLAGS = $(AM_CPPFLAGS)
685-
crypto_libbitcoin_crypto_sse41_a_CXXFLAGS += $(SSE41_CXXFLAGS)
686-
crypto_libbitcoin_crypto_sse41_a_CPPFLAGS += -DENABLE_SSE41
687-
crypto_libbitcoin_crypto_sse41_a_SOURCES = crypto/sha256_sse41.cpp
688-
689-
crypto_libbitcoin_crypto_avx2_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
690-
crypto_libbitcoin_crypto_avx2_a_CPPFLAGS = $(AM_CPPFLAGS)
691-
crypto_libbitcoin_crypto_avx2_a_CXXFLAGS += $(AVX2_CXXFLAGS)
692-
crypto_libbitcoin_crypto_avx2_a_CPPFLAGS += -DENABLE_AVX2
693-
crypto_libbitcoin_crypto_avx2_a_SOURCES = crypto/sha256_avx2.cpp
692+
# See explanation for -static in crypto_libbitcoin_crypto_base_la's LDFLAGS and
693+
# CXXFLAGS above
694+
crypto_libbitcoin_crypto_sse41_la_LDFLAGS = $(AM_LDFLAGS) -static
695+
crypto_libbitcoin_crypto_sse41_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static
696+
crypto_libbitcoin_crypto_sse41_la_CPPFLAGS = $(AM_CPPFLAGS)
697+
crypto_libbitcoin_crypto_sse41_la_CXXFLAGS += $(SSE41_CXXFLAGS)
698+
crypto_libbitcoin_crypto_sse41_la_CPPFLAGS += -DENABLE_SSE41
699+
crypto_libbitcoin_crypto_sse41_la_SOURCES = crypto/sha256_sse41.cpp
700+
701+
# See explanation for -static in crypto_libbitcoin_crypto_base_la's LDFLAGS and
702+
# CXXFLAGS above
703+
crypto_libbitcoin_crypto_avx2_la_LDFLAGS = $(AM_LDFLAGS) -static
704+
crypto_libbitcoin_crypto_avx2_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static
705+
crypto_libbitcoin_crypto_avx2_la_CPPFLAGS = $(AM_CPPFLAGS)
706+
crypto_libbitcoin_crypto_avx2_la_CXXFLAGS += $(AVX2_CXXFLAGS)
707+
crypto_libbitcoin_crypto_avx2_la_CPPFLAGS += -DENABLE_AVX2
708+
crypto_libbitcoin_crypto_avx2_la_SOURCES = crypto/sha256_avx2.cpp
694709

695710
# x11
696-
crypto_libbitcoin_crypto_base_a_SOURCES += \
711+
crypto_libbitcoin_crypto_base_la_SOURCES += \
697712
crypto/x11/aes_helper.c \
698713
crypto/x11/blake.c \
699714
crypto/x11/bmw.c \
@@ -719,17 +734,23 @@ crypto_libbitcoin_crypto_base_a_SOURCES += \
719734
crypto/x11/sph_skein.h \
720735
crypto/x11/sph_types.h
721736

722-
crypto_libbitcoin_crypto_x86_shani_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
723-
crypto_libbitcoin_crypto_x86_shani_a_CPPFLAGS = $(AM_CPPFLAGS)
724-
crypto_libbitcoin_crypto_x86_shani_a_CXXFLAGS += $(X86_SHANI_CXXFLAGS)
725-
crypto_libbitcoin_crypto_x86_shani_a_CPPFLAGS += -DENABLE_X86_SHANI
726-
crypto_libbitcoin_crypto_x86_shani_a_SOURCES = crypto/sha256_x86_shani.cpp
727-
728-
crypto_libbitcoin_crypto_arm_shani_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
729-
crypto_libbitcoin_crypto_arm_shani_a_CPPFLAGS = $(AM_CPPFLAGS)
730-
crypto_libbitcoin_crypto_arm_shani_a_CXXFLAGS += $(ARM_SHANI_CXXFLAGS)
731-
crypto_libbitcoin_crypto_arm_shani_a_CPPFLAGS += -DENABLE_ARM_SHANI
732-
crypto_libbitcoin_crypto_arm_shani_a_SOURCES = crypto/sha256_arm_shani.cpp
737+
# See explanation for -static in crypto_libbitcoin_crypto_base_la's LDFLAGS and
738+
# CXXFLAGS above
739+
crypto_libbitcoin_crypto_x86_shani_la_LDFLAGS = $(AM_LDFLAGS) -static
740+
crypto_libbitcoin_crypto_x86_shani_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static
741+
crypto_libbitcoin_crypto_x86_shani_la_CPPFLAGS = $(AM_CPPFLAGS)
742+
crypto_libbitcoin_crypto_x86_shani_la_CXXFLAGS += $(X86_SHANI_CXXFLAGS)
743+
crypto_libbitcoin_crypto_x86_shani_la_CPPFLAGS += -DENABLE_SSE41 -DENABLE_X86_SHANI
744+
crypto_libbitcoin_crypto_x86_shani_la_SOURCES = crypto/sha256_x86_shani.cpp
745+
746+
# See explanation for -static in crypto_libbitcoin_crypto_base_la's LDFLAGS and
747+
# CXXFLAGS above
748+
crypto_libbitcoin_crypto_arm_shani_la_LDFLAGS = $(AM_LDFLAGS) -static
749+
crypto_libbitcoin_crypto_arm_shani_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static
750+
crypto_libbitcoin_crypto_arm_shani_la_CPPFLAGS = $(AM_CPPFLAGS)
751+
crypto_libbitcoin_crypto_arm_shani_la_CXXFLAGS += $(ARM_SHANI_CXXFLAGS)
752+
crypto_libbitcoin_crypto_arm_shani_la_CPPFLAGS += -DENABLE_ARM_SHANI
753+
crypto_libbitcoin_crypto_arm_shani_la_SOURCES = crypto/sha256_arm_shani.cpp
733754

734755
# consensus: shared between all executables that validate any consensus rules.
735756
libbitcoin_consensus_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS)
@@ -905,7 +926,6 @@ bitcoin_bin_ldadd = \
905926
$(LIBBITCOIN_CRYPTO) \
906927
$(LIBDASHBLS) \
907928
$(LIBLEVELDB) \
908-
$(LIBLEVELDB_SSE42) \
909929
$(LIBMEMENV) \
910930
$(LIBSECP256K1)
911931

@@ -978,11 +998,11 @@ endif
978998
# dashconsensus library #
979999
if BUILD_BITCOIN_LIBS
9801000
include_HEADERS = script/bitcoinconsensus.h
981-
libdashconsensus_la_SOURCES = support/cleanse.cpp $(crypto_libbitcoin_crypto_base_a_SOURCES) $(libbitcoin_consensus_a_SOURCES)
1001+
libdashconsensus_la_SOURCES = support/cleanse.cpp $(crypto_libbitcoin_crypto_base_la_SOURCES) $(libbitcoin_consensus_a_SOURCES)
9821002

9831003
libdashconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS)
9841004
libdashconsensus_la_LIBADD = $(LIBDASHBLS) $(LIBSECP256K1) $(GMP_LIBS)
985-
libdashconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL
1005+
libdashconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL -DDISABLE_OPTIMIZED_SHA256
9861006
libdashconsensus_la_CPPFLAGS += -isystem$(srcdir)/dashbls/include -isystem$(srcdir)/dashbls/depends/relic/include -isystem$(srcdir)/dashbls/depends/minialloc/include
9871007
libdashconsensus_la_CPPFLAGS += -isystem$(srcdir)/immer
9881008
libdashconsensus_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)

src/Makefile.bench.include

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,15 @@ bench_bench_dash_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS)
6161
bench_bench_dash_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
6262
bench_bench_dash_LDFLAGS = $(LDFLAGS_WRAP_EXCEPTIONS) $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
6363
bench_bench_dash_LDADD = \
64+
$(LIBTEST_UTIL) \
6465
$(LIBBITCOIN_NODE) \
6566
$(LIBBITCOIN_WALLET) \
6667
$(LIBBITCOIN_COMMON) \
6768
$(LIBBITCOIN_UTIL) \
6869
$(LIBBITCOIN_CONSENSUS) \
6970
$(LIBBITCOIN_CRYPTO) \
7071
$(LIBDASHBLS) \
71-
$(LIBTEST_UTIL) \
7272
$(LIBLEVELDB) \
73-
$(LIBLEVELDB_SSE42) \
7473
$(LIBMEMENV) \
7574
$(LIBSECP256K1) \
7675
$(LIBUNIVALUE) \

0 commit comments

Comments
 (0)