From 0b35db2bb5dd3e8f21b7f69cd9c72616ab7507b1 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 20 Sep 2021 15:15:32 +0200 Subject: [PATCH] bitcoin-core: Temp workaround for UBSan build failure (#6465) --- projects/bitcoin-core/build.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/projects/bitcoin-core/build.sh b/projects/bitcoin-core/build.sh index 605df8d48..a89691a38 100755 --- a/projects/bitcoin-core/build.sh +++ b/projects/bitcoin-core/build.sh @@ -37,6 +37,13 @@ fi sed -i "s|PROVIDE_FUZZ_MAIN_FUNCTION|NEVER_PROVIDE_MAIN_FOR_OSS_FUZZ|g" "./configure.ac" ./autogen.sh +# Temporarily compile with O2 to work around clang-13 (and later) UBSan +# -fsanitize=vptr,object-size false positive that only happens with -O1 +if [ "$SANITIZER" = "undefined" ]; then + export CFLAGS="$CFLAGS -O2" + export CXXFLAGS="$CXXFLAGS -O2" +fi + # OSS-Fuzz will provide CC, CXX, etc. So only set: # * --enable-fuzz, see https://github.com/bitcoin/bitcoin/blob/master/doc/fuzzing.md # * CONFIG_SITE, see https://github.com/bitcoin/bitcoin/blob/master/depends/README.md