diff --git a/fuzzers/nyx_libxml2_parallel/setup_libxml2.sh b/fuzzers/nyx_libxml2_parallel/setup_libxml2.sh index 42ddafdca0..821e22a52c 100755 --- a/fuzzers/nyx_libxml2_parallel/setup_libxml2.sh +++ b/fuzzers/nyx_libxml2_parallel/setup_libxml2.sh @@ -1,11 +1,24 @@ -#!/bin/sh +#!/bin/bash # cargo build --release # PWD=$(pwd) # export CC="$PWD/target/release/libafl_cc" # export CXX="$PWD/target/release/libafl_cxx" -export CC=afl-clang-fast -export CXX=afl-clang-fast++ +# Check if afl-clang-fast exists in PATH +if ! command -v afl-clang-fast &> /dev/null +then + echo "afl-clang-fast not found. Cloning and compiling AFLplusplus..." + git clone https://github.com/AFLplusplus/AFLplusplus.git + pushd AFLplusplus + make + popd +else + echo "afl-clang-fast already exists in PATH." +fi + +export CC="$(pwd)/AFLplusplus/afl-clang-fast" +export CXX="$(pwd)/AFLplusplus/afl-clang-fast++" + curl -C - https://gitlab.gnome.org/GNOME/libxml2/-/archive/v2.9.14/libxml2-v2.9.14.tar.gz --output libxml2-v2.9.14.tar.gz tar -xf ./libxml2-v2.9.14.tar.gz --transform s/libxml2-v2.9.14/libxml2/ || exit cd ./libxml2/ || exit diff --git a/fuzzers/nyx_libxml2_standalone/setup_libxml2.sh b/fuzzers/nyx_libxml2_standalone/setup_libxml2.sh index f32d980992..a823d20aa9 100755 --- a/fuzzers/nyx_libxml2_standalone/setup_libxml2.sh +++ b/fuzzers/nyx_libxml2_standalone/setup_libxml2.sh @@ -1,11 +1,23 @@ -#!/bin/sh +#!/bin/bash # cargo build --release # PWD=$(pwd) # export CC="$PWD/target/release/libafl_cc" # export CXX="$PWD/target/release/libafl_cxx" -export CC=afl-clang-fast -export CXX=afl-clang-fast++ +# Check if afl-clang-fast exists in PATH +if ! command -v afl-clang-fast &> /dev/null +then + echo "afl-clang-fast not found. Cloning and compiling AFLplusplus..." + git clone https://github.com/AFLplusplus/AFLplusplus.git + pushd AFLplusplus + make + popd +else + echo "afl-clang-fast already exists in PATH." +fi + +export CC="$(pwd)/AFLplusplus/afl-clang-fast" +export CXX="$(pwd)/AFLplusplus/afl-clang-fast++" curl -C - https://gitlab.gnome.org/GNOME/libxml2/-/archive/v2.9.14/libxml2-v2.9.14.tar.gz --output libxml2-v2.9.14.tar.gz tar -xf ./libxml2-v2.9.14.tar.gz --transform s/libxml2-v2.9.14/libxml2/ || exit cd ./libxml2/ || exit diff --git a/scripts/test_all_fuzzers.sh b/scripts/test_all_fuzzers.sh index b21f0d93c5..269caccb0e 100755 --- a/scripts/test_all_fuzzers.sh +++ b/scripts/test_all_fuzzers.sh @@ -5,13 +5,13 @@ cd "$SCRIPT_DIR/.." || exit 1 # TODO: This should be rewritten in rust, a Makefile, or some platform-independent language if [[ -z "${RUN_ON_CI}" ]]; then - fuzzers=$(find ./fuzzers -mindepth 1 -maxdepth 1 -type d) - backtrace_fuzzers=$(find ./fuzzers/backtrace_baby_fuzzers -mindepth 1 -maxdepth 1 -type d) - export PROFILE=dev + fuzzers=$(find ./fuzzers -mindepth 1 -maxdepth 1 -type d) + backtrace_fuzzers=$(find ./fuzzers/backtrace_baby_fuzzers -mindepth 1 -maxdepth 1 -type d) else - cargo build -p build_and_test_fuzzers - fuzzers=$(cargo run -p build_and_test_fuzzers -- "remotes/origin/main" "HEAD^") - backtrace_fuzzers="" + cargo build -p build_and_test_fuzzers + fuzzers=$(cargo run -p build_and_test_fuzzers -- "remotes/origin/main" "HEAD^") + backtrace_fuzzers="" + export PROFILE=dev fi libafl=$(pwd)