From 62d43a54894d8ee69025b781e3f34d72f7da51e9 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 4 May 2021 16:44:42 +0200 Subject: [PATCH] bitcoin-core: Add i386 (#5709) --- projects/bitcoin-core/build.sh | 14 +++++++++----- projects/bitcoin-core/project.yaml | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/projects/bitcoin-core/build.sh b/projects/bitcoin-core/build.sh index f45b3ec12..1b077d4e5 100755 --- a/projects/bitcoin-core/build.sh +++ b/projects/bitcoin-core/build.sh @@ -15,20 +15,23 @@ # ################################################################################ -# Temporary workaround for https://github.com/google/oss-fuzz/issues/5697 -wget https://github.com/bitcoin/bitcoin/commit/0be1cb158899374722961b844f9f4b0dc5f8558b.patch -( patch -p1 < ./*.patch ) || true - # Build dependencies # This will also force static builds if [ "$ARCHITECTURE" = "i386" ]; then export BUILD_TRIPLET="i686-pc-linux-gnu" + # Temporary workaround for: + # CXXLD test/fuzz/fuzz + # test/fuzz/test_fuzz_fuzz-multiplication_overflow.o: In function `void (anonymous namespace)::TestMultiplicationOverflow(FuzzedDataProvider&)': + # /src/bitcoin-core/src/test/fuzz/multiplication_overflow.cpp:30: undefined reference to `__mulodi4' + # clang-12: error: linker command failed with exit code 1 (use -v to see invocation) + # Makefile:5495: recipe for target 'test/fuzz/fuzz' failed + sed -i 's|defined(HAVE_BUILTIN_MUL_OVERFLOW)|defined(IGNORE_BUILTIN_MUL_OVERFLOW)|g' "./src/test/fuzz/multiplication_overflow.cpp" else export BUILD_TRIPLET="x86_64-pc-linux-gnu" fi ( cd depends - make HOST=$BUILD_TRIPLET DEBUG=1 NO_QT=1 NO_WALLET=1 NO_ZMQ=1 NO_UPNP=1 NO_NATPMP=1 -j$(nproc) + make HOST=$BUILD_TRIPLET DEBUG=1 NO_QT=1 NO_WALLET=1 NO_ZMQ=1 NO_UPNP=1 NO_NATPMP=1 boost_cxxflags="-std=c++17 -fvisibility=hidden -fPIC ${CXXFLAGS}" libevent_cflags="${CFLAGS}" -j$(nproc) ) # Build the fuzz targets @@ -50,6 +53,7 @@ make -j$(nproc) # Limit to a few targets as temporary workaround for https://github.com/google/oss-fuzz/pull/5699#issuecomment-831030305 FUZZ_TARGETS=( 'process_messages' 'asmap' ) for fuzz_target in ${FUZZ_TARGETS[@]}; do + git checkout -- "./src/test/fuzz/fuzz.cpp" sed -i "s|std::getenv(\"FUZZ\")|\"$fuzz_target\"|g" "./src/test/fuzz/fuzz.cpp" make -j$(nproc) mv ./src/test/fuzz/fuzz $OUT/$fuzz_target diff --git a/projects/bitcoin-core/project.yaml b/projects/bitcoin-core/project.yaml index f7cb974ae..c217b4c0b 100644 --- a/projects/bitcoin-core/project.yaml +++ b/projects/bitcoin-core/project.yaml @@ -14,6 +14,7 @@ sanitizers: - undefined architectures: - x86_64 + - i386 fuzzing_engines: - libfuzzer - honggfuzz