Skip to content

Commit

Permalink
fixup! cmake: Rename build option FUZZ to ENABLE_FUZZ
Browse files Browse the repository at this point in the history
Rename missed cases.
  • Loading branch information
hebasto committed May 23, 2024
1 parent 6c2be70 commit 97f4a60
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_native_fuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
Expand Down
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_native_fuzz_with_msan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_native_fuzz_with_valgrind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions doc/fuzzing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
```
Expand All @@ -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)`
Expand Down Expand Up @@ -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/
Expand Down Expand Up @@ -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
```
Expand Down

0 comments on commit 97f4a60

Please sign in to comment.