From eeec2f279990f4a46dd89e71106cb25df7e71321 Mon Sep 17 00:00:00 2001 From: fanquake Date: Sun, 9 May 2021 11:25:18 +0800 Subject: [PATCH] Merge bitcoin/bitcoin#21884: fuzz: Remove unused --enable-danger-fuzz-link-all option fa27d6d3ac065684a1219e9a948514d27929cf7c fuzz: Remove unused --enable-danger-fuzz-link-all option (MarcoFalke) Pull request description: Remove the unused build option, which was *dangerous* (as the name implies). Also remove the fuzzbuzz config, which was never used as part of this repo and seems redundant now that we integrate with oss-fuzz. ACKs for top commit: practicalswift: cr ACK fa27d6d3ac065684a1219e9a948514d27929cf7c: patch looks correct and rationale makes sense hebasto: ACK fa27d6d3ac065684a1219e9a948514d27929cf7c, I have reviewed the code and it looks OK, I agree it can be merged. Tree-SHA512: 9bd65ed6a76d13d8d9c7a88aaae30f701215d5d0619693a3115d5ec350808aaf6a1aa4737466a5b96f3948513ec4d063808fe16219818366720e247880a15177 --- .fuzzbuzz.yml | 16 ---------------- configure.ac | 7 ------- src/Makefile.test.include | 5 ----- src/test/fuzz/danger_link_all.sh | 28 ---------------------------- 4 files changed, 56 deletions(-) delete mode 100644 .fuzzbuzz.yml delete mode 100755 src/test/fuzz/danger_link_all.sh diff --git a/.fuzzbuzz.yml b/.fuzzbuzz.yml deleted file mode 100644 index feace80d60..0000000000 --- a/.fuzzbuzz.yml +++ /dev/null @@ -1,16 +0,0 @@ -base: ubuntu:focal -language: c++ -engine: libFuzzer -environment: - - CXXFLAGS=-fcoverage-mapping -fno-omit-frame-pointer -fprofile-instr-generate -gline-tables-only -O1 -setup: - - sudo apt-get update - - sudo apt-get install -y autoconf bsdmainutils clang git libboost-system-dev libboost-filesystem-dev libboost-test-dev libc++1 libc++abi1 libc++abi-dev libc++-dev libclang1 libclang-dev libdb5.3++ libevent-dev libllvm-ocaml-dev libomp5 libomp-dev libqt5core5a libqt5dbus5 libqt5gui5 libtool llvm llvm-dev llvm-runtime pkg-config qttools5-dev qttools5-dev-tools software-properties-common - - ./autogen.sh - - CC=clang CXX=clang++ ./configure --enable-fuzz --with-sanitizers=address,fuzzer,undefined --enable-danger-fuzz-link-all - - make - - git clone https://github.com/bitcoin-core/qa-assets -auto_targets: - find_targets_command: find src/test/fuzz/ -executable -type f ! -name "*.cpp" ! -name "*.h" - base_corpus_dir: qa-assets/fuzz_seed_corpus/ - memory_limit: none diff --git a/configure.ac b/configure.ac index 76133de1de..7249fe4fc0 100644 --- a/configure.ac +++ b/configure.ac @@ -185,12 +185,6 @@ AC_ARG_ENABLE([fuzz-binary], [enable_fuzz_binary=$enableval], [enable_fuzz_binary=yes]) -AC_ARG_ENABLE([danger_fuzz_link_all], - AS_HELP_STRING([--enable-danger-fuzz-link-all], - [Danger! Modifies source code. Needs git and gnu sed installed. Link each fuzz target (default no).]), - [enable_danger_fuzz_link_all=$enableval], - [enable_danger_fuzz_link_all=no]) - AC_ARG_WITH([qrencode], [AS_HELP_STRING([--with-qrencode], [enable QR code support (default is yes if qt is enabled and libqrencode is found)])], @@ -1818,7 +1812,6 @@ AM_CONDITIONAL([ENABLE_TRACING],[test x$have_sdt = xyes]) AM_CONDITIONAL([ENABLE_TESTS],[test x$BUILD_TEST = xyes]) AM_CONDITIONAL([ENABLE_FUZZ],[test x$enable_fuzz = xyes]) AM_CONDITIONAL([ENABLE_FUZZ_BINARY],[test x$enable_fuzz_binary = xyes]) -AM_CONDITIONAL([ENABLE_FUZZ_LINK_ALL],[test x$enable_danger_fuzz_link_all = xyes]) AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes]) AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$BUILD_TEST_QT = xyes]) AM_CONDITIONAL([ENABLE_BENCH],[test x$use_bench = xyes]) diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 4f54e3276e..3f71e6112f 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -398,11 +398,6 @@ univalue_test_object_CPPFLAGS = -I$(srcdir)/$(UNIVALUE_INCLUDE_DIR_INT) univalue_test_object_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS) endif -if ENABLE_FUZZ_LINK_ALL -all-local: $(FUZZ_BINARY) - bash ./test/fuzz/danger_link_all.sh -endif - %.cpp.test: %.cpp @echo Running tests: $$(\ cat $< | \ diff --git a/src/test/fuzz/danger_link_all.sh b/src/test/fuzz/danger_link_all.sh deleted file mode 100755 index 2ddd00c658..0000000000 --- a/src/test/fuzz/danger_link_all.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) 2020 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -export LC_ALL=C.UTF-8 - -set -e - -ROOT_DIR="$(git rev-parse --show-toplevel)" - -# Run only once (break make recursion) -if [ -d "${ROOT_DIR}/lock_fuzz_link_all" ]; then - exit -fi -mkdir "${ROOT_DIR}/lock_fuzz_link_all" - -echo "Linking each fuzz target separately." -for FUZZING_HARNESS in $(PRINT_ALL_FUZZ_TARGETS_AND_ABORT=1 "${ROOT_DIR}/src/test/fuzz/fuzz" | sort -u); do - echo "Building src/test/fuzz/${FUZZING_HARNESS} ..." - git checkout -- "${ROOT_DIR}/src/test/fuzz/fuzz.cpp" - sed -i "s/std::getenv(\"FUZZ\")/\"${FUZZING_HARNESS}\"/g" "${ROOT_DIR}/src/test/fuzz/fuzz.cpp" - make - mv "${ROOT_DIR}/src/test/fuzz/fuzz" "${ROOT_DIR}/src/test/fuzz/${FUZZING_HARNESS}" -done -git checkout -- "${ROOT_DIR}/src/test/fuzz/fuzz.cpp" -rmdir "${ROOT_DIR}/lock_fuzz_link_all" -echo "Successfully built all fuzz targets."