Skip to content

Commit ec1f492

Browse files
committed
merge bitcoin#29407: remove confusing and inconsistent disable-asm option
1 parent 9440c18 commit ec1f492

File tree

5 files changed

+4
-36
lines changed

5 files changed

+4
-36
lines changed

configure.ac

Lines changed: 0 additions & 16 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.
@@ -696,8 +684,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
696684
)
697685
CXXFLAGS="$TEMP_CXXFLAGS"
698686

699-
fi
700-
701687
CORE_CPPFLAGS="$CORE_CPPFLAGS -DHAVE_BUILD_INFO -DGSL_NO_IOSTREAMS"
702688

703689
AC_ARG_WITH([utils],
@@ -1843,7 +1829,6 @@ AM_CONDITIONAL([ENABLE_AVX2], [test "$enable_avx2" = "yes"])
18431829
AM_CONDITIONAL([ENABLE_X86_SHANI], [test "$enable_x86_shani" = "yes"])
18441830
AM_CONDITIONAL([ENABLE_ARM_CRC], [test "$enable_arm_crc" = "yes"])
18451831
AM_CONDITIONAL([ENABLE_ARM_SHANI], [test "$enable_arm_shani" = "yes"])
1846-
AM_CONDITIONAL([USE_ASM], [test "$use_asm" = "yes"])
18471832
AM_CONDITIONAL([WORDS_BIGENDIAN], [test "$ac_cv_c_bigendian" = "yes"])
18481833
AM_CONDITIONAL([USE_NATPMP], [test "$use_natpmp" = "yes"])
18491834
AM_CONDITIONAL([USE_UPNP], [test "$use_upnp" = "yes"])
@@ -1988,7 +1973,6 @@ echo " with fuzz binary = $enable_fuzz_binary"
19881973
echo " with bench = $use_bench"
19891974
echo " with upnp = $use_upnp"
19901975
echo " with natpmp = $use_natpmp"
1991-
echo " use asm = $use_asm"
19921976
echo " USDT tracing = $use_usdt"
19931977
echo " sanitizers = $use_sanitizers"
19941978
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: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,8 @@ LIBBITCOIN_WALLET_TOOL=libbitcoin_wallet_tool.a
7373
endif
7474

7575
LIBBITCOIN_CRYPTO = $(LIBBITCOIN_CRYPTO_BASE)
76-
if USE_ASM
7776
LIBBITCOIN_CRYPTO_SSE4 = crypto/libbitcoin_crypto_sse4.la
7877
LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_SSE4)
79-
endif
8078
if ENABLE_SSE41
8179
LIBBITCOIN_CRYPTO_SSE41 = crypto/libbitcoin_crypto_sse41.la
8280
LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_SSE41)

src/crypto/sha256.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@
2222
#endif
2323

2424
#if defined(__x86_64__) || defined(__amd64__) || defined(__i386__)
25-
#if defined(USE_ASM)
2625
namespace sha256_sse4
2726
{
2827
void Transform(uint32_t* s, const unsigned char* chunk, size_t blocks);
2928
}
3029
#endif
31-
#endif
3230

3331
namespace sha256d64_sse41
3432
{
@@ -570,7 +568,7 @@ bool SelfTest() {
570568
}
571569

572570
#if !defined(DISABLE_OPTIMIZED_SHA256)
573-
#if defined(USE_ASM) && (defined(__x86_64__) || defined(__amd64__) || defined(__i386__))
571+
#if (defined(__x86_64__) || defined(__amd64__) || defined(__i386__))
574572
/** Check whether the OS has enabled AVX registers. */
575573
bool AVXEnabled()
576574
{
@@ -593,7 +591,7 @@ std::string SHA256AutoDetect(sha256_implementation::UseImplementation use_implem
593591
TransformD64_8way = nullptr;
594592

595593
#if !defined(DISABLE_OPTIMIZED_SHA256)
596-
#if defined(USE_ASM) && defined(HAVE_GETCPUID)
594+
#if defined(HAVE_GETCPUID)
597595
bool have_sse4 = false;
598596
bool have_xsave = false;
599597
bool have_avx = false;
@@ -650,7 +648,7 @@ std::string SHA256AutoDetect(sha256_implementation::UseImplementation use_implem
650648
ret += ",avx2(8way)";
651649
}
652650
#endif
653-
#endif // defined(USE_ASM) && defined(HAVE_GETCPUID)
651+
#endif // defined(HAVE_GETCPUID)
654652

655653
#if defined(ENABLE_ARM_SHANI)
656654
bool have_arm_shani = false;

0 commit comments

Comments
 (0)