On macOS 10.15 Catalina I get a linker error when trying to use sanitizers. Using Apple clang version 11.0.0 (clang-1100.0.33.8). The CC=clang is probably redundant.
./configure --disable-bip70 --disable-bench --enable-debug CFLAGS="-fno-stack-check" CPPFLAGS=-DDEBUG_LOCKORDER --with-sanitizers=address,integer,undefined CC=clang CXX=clang++ --disable-asm
...
Build Options:
with endomorphism = no
with ecmult precomp = yes
with jni = no
with benchmarks = no
with coverage = no
module ecdh = no
module recovery = yes
asm = x86_64
bignum = no
field = 64bit
scalar = 64bit
CC = clang
CFLAGS = -fno-stack-check -W -std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-unused-function -Wno-long-long -Wno-overlength-strings -fvisibility=hidden -O3
CPPFLAGS = -DDEBUG_LOCKORDER
LDFLAGS =
Options used to compile and link:
with wallet = yes
with gui / qt = yes
with bip70 = no
with qr = yes
with zmq = yes
with test = yes
with prop = no
with fuzz = no
with bench = no
with upnp = yes
use asm = no
sanitizers = address,integer,undefined
debug enabled = yes
gprof enabled = no
werror = no
target os = darwin
build os = darwin
CC = /usr/local/bin/ccache clang
CFLAGS = -fno-stack-check
CPPFLAGS = -DDEBUG -DDEBUG_LOCKORDER -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Qunused-arguments -DDEBUG_LOCKORDER -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -I/usr/local/opt/berkeley-db@4/include -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0
CXX = /usr/local/bin/ccache clang++ -std=c++11
CXXFLAGS = -O0 -g3 -ftrapv -Wstack-protector -fstack-protector-all -Wall -Wextra -Wformat -Wvla -Wswitch -Wformat-security -Wthread-safety-analysis -Wrange-loop-analysis -Wredundant-decls -Wno-unused-parameter -Wno-self-assign -Wno-unused-local-typedef -Wno-deprecated-register -Wno-implicit-fallthrough
LDFLAGS = -pthread -Wl,-headerpad_max_install_names -Wl,-dead_strip
ARFLAGS = cr
When running make I get a flood of errors along these lines:
"___asan_register_image_globals", referenced from:
_asan.module_ctor in libbitcoinconsensus_la-cleanse.o
_asan.module_ctor in libbitcoinconsensus_la-aes.o
_asan.module_ctor in libbitcoinconsensus_la-chacha_poly_aead.o
_asan.module_ctor in libbitcoinconsensus_la-chacha20.o
_asan.module_ctor in libbitcoinconsensus_la-hkdf_sha256_32.o
_asan.module_ctor in libbitcoinconsensus_la-poly1305.o
_asan.module_ctor in libbitcoinconsensus_la-ripemd160.o
...
"___ubsan_handle_pointer_overflow", referenced from:
AES_setup(AES_state*, unsigned char const*, int, int) in libbitcoinconsensus_la-aes.o
_AES128_encrypt in libbitcoinconsensus_la-aes.o
AES_encrypt(AES_state const*, int, unsigned char*, unsigned char const*) in libbitcoinconsensus_la-aes.o
_AES128_decrypt in libbitcoinconsensus_la-aes.o
AES_decrypt(AES_state const*, int, unsigned char*, unsigned char const*) in libbitcoinconsensus_la-aes.o
_AES192_encrypt in libbitcoinconsensus_la-aes.o
_AES192_decrypt in libbitcoinconsensus_la-aes.o
...
"___asan_version_mismatch_check_apple_clang_1100", referenced from:
_asan.module_ctor in libbitcoinconsensus_la-cleanse.o
_asan.module_ctor in libbitcoinconsensus_la-aes.o
_asan.module_ctor in libbitcoinconsensus_la-chacha_poly_aead.o
_asan.module_ctor in libbitcoinconsensus_la-chacha20.o
_asan.module_ctor in libbitcoinconsensus_la-hkdf_sha256_32.o
_asan.module_ctor in libbitcoinconsensus_la-hmac_sha256.o
_asan.module_ctor in libbitcoinconsensus_la-hmac_sha512.o
...
"___ubsan_handle_implicit_conversion", referenced from:
AES_setup(AES_state*, unsigned char const*, int, int) in libbitcoinconsensus_la-aes.o
int CBCEncrypt<AES256Encrypt>(AES256Encrypt const&, unsigned char const*, unsigned char const*, int, bool, unsigned char*) in libbitcoinconsensus_la-aes.o
int CBCDecrypt<AES256Decrypt>(AES256Decrypt const&, unsigned char const*, unsigned char const*, int, bool, unsigned char*) in libbitcoinconsensus_la-aes.o
LoadByte(AES_state*, unsigned char, int, int) in libbitcoinconsensus_la-aes.o
GetOneColumn(AES_state*, AES_state const*, int) in libbitcoinconsensus_la-aes.o
SubBytes(AES_state*, int) in libbitcoinconsensus_la-aes.o
KeySetupTransform(AES_state*, AES_state const*) in libbitcoinconsensus_la-aes.o
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libbitcoinconsensus.la] Error 1