From 97f4a60e7a68a9ac40c0e7d94bb414b8995b7817 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 23 May 2024 12:15:04 +0100 Subject: [PATCH] fixup! cmake: Rename build option `FUZZ` to `ENABLE_FUZZ` Rename missed cases. --- ci/test/00_setup_env_native_fuzz.sh | 2 +- ci/test/00_setup_env_native_fuzz_with_msan.sh | 2 +- ci/test/00_setup_env_native_fuzz_with_valgrind.sh | 2 +- doc/fuzzing.md | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ci/test/00_setup_env_native_fuzz.sh b/ci/test/00_setup_env_native_fuzz.sh index bb35778fed776..f2a627e71ef27 100755 --- a/ci/test/00_setup_env_native_fuzz.sh +++ b/ci/test/00_setup_env_native_fuzz.sh @@ -15,7 +15,7 @@ export RUN_FUNCTIONAL_TESTS=false 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="-DFUZZ=ON -DSANITIZERS=fuzzer,address,undefined,float-divide-by-zero,integer \ +export BITCOIN_CONFIG="-DENABLE_FUZZ=ON -DSANITIZERS=fuzzer,address,undefined,float-divide-by-zero,integer \ -DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18 \ -DCMAKE_C_FLAGS='-ftrivial-auto-var-init=pattern' \ -DCMAKE_CXX_FLAGS='-ftrivial-auto-var-init=pattern'" 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 b8cd372c0c603..50f2064dc38ca 100755 --- a/ci/test/00_setup_env_native_fuzz_with_msan.sh +++ b/ci/test/00_setup_env_native_fuzz_with_msan.sh @@ -18,7 +18,7 @@ export PACKAGES="ninja-build" export DEP_OPTS="DEBUG=1 NO_BDB=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'" export GOAL="install" # _FORTIFY_SOURCE is not compatible with MSAN. -export BITCOIN_CONFIG="-DFUZZ=ON -DSANITIZERS=fuzzer,memory -DCMAKE_CXX_FLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE' \ +export BITCOIN_CONFIG="-DENABLE_FUZZ=ON -DSANITIZERS=fuzzer,memory -DCMAKE_CXX_FLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE' \ -DAPPEND_CPPFLAGS='-U_FORTIFY_SOURCE'" export USE_MEMORY_SANITIZER="true" export RUN_UNIT_TESTS="false" 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 233d36ca44f25..38a922cd69e7e 100755 --- a/ci/test/00_setup_env_native_fuzz_with_valgrind.sh +++ b/ci/test/00_setup_env_native_fuzz_with_valgrind.sh @@ -15,5 +15,5 @@ export RUN_FUNCTIONAL_TESTS=false export RUN_FUZZ_TESTS=true export FUZZ_TESTS_CONFIG="--valgrind" export GOAL="install" -export BITCOIN_CONFIG="-DFUZZ=ON -DSANITIZERS=fuzzer -DCMAKE_C_COMPILER=clang-16 -DCMAKE_CXX_COMPILER=clang++-16" +export BITCOIN_CONFIG="-DENABLE_FUZZ=ON -DSANITIZERS=fuzzer -DCMAKE_C_COMPILER=clang-16 -DCMAKE_CXX_COMPILER=clang++-16" export CCACHE_MAXSIZE=200M diff --git a/doc/fuzzing.md b/doc/fuzzing.md index b173da4fff96d..13775fe2567c8 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++" \ - -DFUZZ=ON \ + -DENABLE_FUZZ=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++" \ - -DFUZZ=ON \ + -DENABLE_FUZZ=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++" \ - -DFUZZ=ON + -DENABLE_FUZZ=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++" \ - -DFUZZ=ON \ + -DENABLE_FUZZ=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 -DFUZZ=ON +$ cmake -B build_fuzz -DENABLE_FUZZ=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 ```