diff --git a/CMakeLists.txt b/CMakeLists.txt index 44295f154e4269..b02d75888be4cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,7 +181,7 @@ endif() option(BUILD_BENCH "Build bench_bitcoin executable." OFF) option(BUILD_FUZZ_BINARY "Build fuzz binary." OFF) -cmake_dependent_option(ENABLE_FUZZ "Build for fuzzing. Enabling this will disable all other targets and override BUILD_FUZZ_BINARY." OFF "NOT MSVC" OFF) +cmake_dependent_option(BUILD_FOR_FUZZING "Build for fuzzing. Enabling this will disable all other targets and override BUILD_FUZZ_BINARY." OFF "NOT MSVC" OFF) option(INSTALL_MAN "Install man pages." ON) @@ -219,8 +219,8 @@ target_link_libraries(core_interface INTERFACE $<$:core_interface_debug> ) -if(ENABLE_FUZZ) - message(WARNING "ENABLE_FUZZ=ON will disable all other targets and force BUILD_FUZZ_BINARY=ON.") +if(BUILD_FOR_FUZZING) + message(WARNING "BUILD_FOR_FUZZING=ON will disable all other targets and force BUILD_FUZZ_BINARY=ON.") set(BUILD_DAEMON OFF) set(BUILD_CLI OFF) set(BUILD_TX OFF) diff --git a/ci/test/00_setup_env_native_fuzz.sh b/ci/test/00_setup_env_native_fuzz.sh index 4f502c444e02e7..e1a353056df8fe 100755 --- a/ci/test/00_setup_env_native_fuzz.sh +++ b/ci/test/00_setup_env_native_fuzz.sh @@ -16,7 +16,7 @@ export RUN_FUZZ_TESTS=true export GOAL="install" export CI_CONTAINER_CAP="--cap-add SYS_PTRACE" # If run with (ASan + LSan), the container needs access to ptrace (https://github.com/google/sanitizers/issues/764) export BITCOIN_CONFIG="\ - -DENABLE_FUZZ=ON \ + -DBUILD_FOR_FUZZING=ON \ -DSANITIZERS=fuzzer,address,undefined,float-divide-by-zero,integer \ -DCMAKE_C_COMPILER=clang-18 \ -DCMAKE_CXX_COMPILER=clang++-18 \ diff --git a/ci/test/00_setup_env_native_fuzz_with_msan.sh b/ci/test/00_setup_env_native_fuzz_with_msan.sh index e9b315f50334af..85f02c01c522f7 100755 --- a/ci/test/00_setup_env_native_fuzz_with_msan.sh +++ b/ci/test/00_setup_env_native_fuzz_with_msan.sh @@ -19,7 +19,7 @@ export DEP_OPTS="DEBUG=1 NO_BDB=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FL export GOAL="install" # _FORTIFY_SOURCE is not compatible with MSAN. export BITCOIN_CONFIG="\ - -DENABLE_FUZZ=ON \ + -DBUILD_FOR_FUZZING=ON \ -DSANITIZERS=fuzzer,memory \ -DAPPEND_CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE -U_FORTIFY_SOURCE' \ " diff --git a/ci/test/00_setup_env_native_fuzz_with_valgrind.sh b/ci/test/00_setup_env_native_fuzz_with_valgrind.sh index e1557091c2cef7..02903b5199590d 100755 --- a/ci/test/00_setup_env_native_fuzz_with_valgrind.sh +++ b/ci/test/00_setup_env_native_fuzz_with_valgrind.sh @@ -16,7 +16,7 @@ export RUN_FUZZ_TESTS=true export FUZZ_TESTS_CONFIG="--valgrind" export GOAL="install" export BITCOIN_CONFIG="\ - -DENABLE_FUZZ=ON \ + -DBUILD_FOR_FUZZING=ON \ -DSANITIZERS=fuzzer \ -DCMAKE_C_COMPILER=clang-16 \ -DCMAKE_CXX_COMPILER=clang++-16 \ diff --git a/doc/fuzzing.md b/doc/fuzzing.md index 13775fe2567c8f..7eb341e992ef99 100644 --- a/doc/fuzzing.md +++ b/doc/fuzzing.md @@ -10,7 +10,7 @@ $ cd bitcoin/ $ cmake -B build_fuzz \ -DCMAKE_C_COMPILER="clang" \ -DCMAKE_CXX_COMPILER="clang++" \ - -DENABLE_FUZZ=ON \ + -DBUILD_FOR_FUZZING=ON \ -DSANITIZERS=undefined,address,fuzzer # macOS users: If you have problem with this step then make sure to read "macOS hints for # libFuzzer" on https://github.com/bitcoin/bitcoin/blob/master/doc/fuzzing.md#macos-hints-for-libfuzzer @@ -148,7 +148,7 @@ Full configuration step that was tested on macOS with `brew` installed `llvm`: $ cmake -B build_fuzz \ -DCMAKE_C_COMPILER="$(brew --prefix llvm)/bin/clang" \ -DCMAKE_CXX_COMPILER="$(brew --prefix llvm)/bin/clang++" \ - -DENABLE_FUZZ=ON \ + -DBUILD_FOR_FUZZING=ON \ -DSANITIZERS=undefined,address,fuzzer \ ``` @@ -170,7 +170,7 @@ $ make -C AFLplusplus/ source-only $ cmake -B build_fuzz \ -DCMAKE_C_COMPILER="$(pwd)/AFLplusplus/afl-clang-lto" \ -DCMAKE_CXX_COMPILER="$(pwd)/AFLplusplus/afl-clang-lto++" \ - -DENABLE_FUZZ=ON + -DBUILD_FOR_FUZZING=ON $ cmake --build build_fuzz -j$(nproc) # For macOS you may need to ignore x86 compilation checks when running "cmake --build". If so, # try compiling using: `AFL_NO_X86=1 cmake --build build_fuzz -j$(nproc)` @@ -199,7 +199,7 @@ $ cd .. $ cmake -B build_fuzz \ -DCMAKE_C_COMPILER="$(pwd)/honggfuzz/hfuzz_cc/hfuzz-clang" \ -DCMAKE_CXX_COMPILER="$(pwd)/honggfuzz/hfuzz_cc/hfuzz-clang++" \ - -DENABLE_FUZZ=ON \ + -DBUILD_FOR_FUZZING=ON \ -DSANITIZERS=address,undefined $ cmake --build build_fuzz -j$(nproc) $ mkdir -p inputs/ @@ -319,7 +319,7 @@ $ cd Eclipser $ git checkout v1.x $ make $ cd .. -$ cmake -B build_fuzz -DENABLE_FUZZ=ON +$ cmake -B build_fuzz -DBUILD_FOR_FUZZING=ON $ mkdir -p outputs/ $ FUZZ=bech32 dotnet ./Eclipser/build/Eclipser.dll fuzz -p build_fuzz/src/test/fuzz/fuzz -t 36000 -o outputs --src stdin ```