fuzz.sh (782B)
1 #!/usr/bin/env bash 2 # This file is used by build.sh to setup fuzzing. 3 4 set +e 5 6 # Default to clang if CC is not set. 7 if [ -z "$CC" ]; then 8 if ! command -v clang &> /dev/null 2>&1; then 9 echo "Fuzzing requires clang!" 10 exit 1 11 fi 12 export CC=clang 13 export CCC=clang++ 14 export CXX=clang++ 15 fi 16 17 gyp_params+=(-Dstatic_libs=1 -Dfuzz=1 -Dsign_libs=0 -Duse_pkcs5_pbkd2_params2_only=1) 18 19 # Add debug symbols even for opt builds. 20 nspr_params+=(--enable-debug-symbols) 21 22 if [ "$fuzz_oss" = 1 ]; then 23 gyp_params+=(-Dno_zdefs=1 -Dfuzz_oss=1) 24 else 25 enable_sanitizer asan 26 enable_sanitizer fuzzer 27 # Ubsan only builds on x64 for the moment. 28 if [ "$target_arch" = "x64" ]; then 29 enable_ubsan 30 fi 31 fi 32 33 if [ "$fuzz_tls" = 1 ]; then 34 gyp_params+=(-Dfuzz_tls=1) 35 fi