
* build fuzzers with shared cargo target dir * Make external build scripts aware of CARGO_TARGET_DIR * fix libmozjpeg fuzzer with shared target dir * fix cargo-make default value for CARGO_TARGET_DIR * avoid ./ in cargo-make for windows compat * CI: cargo-hack's --feature-powerset is too powerful * fuzzer_concolic: support CARGO_TARGET_DIR * ci: install z3 to avoid building from source * ci: update actions * ci: test nightly features with nightly rust * test_all_fuzzers: try pruning more compilation artifacts * ci: fix nightly feature check * ci: apply rust-cache action after checkout (d'oh) The rust-cache action populates the checkout directory, which is promply deleted by the checkout action during checkout.. whoops!
100 lines
2.0 KiB
TOML
100 lines
2.0 KiB
TOML
[env]
|
|
CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } }
|
|
FUZZER_NAME="fuzzer"
|
|
PROJECT_DIR = { script = ["pwd"] }
|
|
|
|
[tasks.unsupported]
|
|
script_runner="@shell"
|
|
script='''
|
|
echo "Cargo-make not integrated yet on this"
|
|
'''
|
|
|
|
# Compilers
|
|
[tasks.cxx]
|
|
linux_alias = "cxx_unix"
|
|
mac_alias = "cxx_unix"
|
|
windows_alias = "unsupported"
|
|
|
|
[tasks.cxx_unix]
|
|
command = "cargo"
|
|
args = ["build" , "--release"]
|
|
|
|
[tasks.cc]
|
|
linux_alias = "cc_unix"
|
|
mac_alias = "cc_unix"
|
|
windows_alias = "unsupported"
|
|
|
|
[tasks.cc_unix]
|
|
command = "cargo"
|
|
args = ["build" , "--release"]
|
|
|
|
# fuzz.o File
|
|
[tasks.fuzz_o]
|
|
linux_alias = "fuzz_o_unix"
|
|
mac_alias = "fuzz_o_unix"
|
|
windows_alias = "unsupported"
|
|
|
|
[tasks.fuzz_o_unix]
|
|
command = "${CARGO_TARGET_DIR}/release/libafl_cc"
|
|
args = ["--libafl-no-link", "-O3", "-c", "fuzz.c", "-o", "fuzz.o"]
|
|
dependencies = ["cc", "cxx"]
|
|
|
|
# Fuzzer
|
|
[tasks.fuzzer]
|
|
linux_alias = "fuzzer_unix"
|
|
mac_alias = "fuzzer_unix"
|
|
windows_alias = "unsupported"
|
|
|
|
[tasks.fuzzer_unix]
|
|
command = "${CARGO_TARGET_DIR}/release/libafl_cxx"
|
|
args = ["--libafl", "fuzz.o", "-o", "${FUZZER_NAME}", "-lm", "-lz"]
|
|
dependencies = ["cc", "cxx", "fuzz_o"]
|
|
|
|
# Run
|
|
[tasks.run]
|
|
linux_alias = "run_unix"
|
|
mac_alias = "run_unix"
|
|
windows_alias = "unsupported"
|
|
|
|
[tasks.run_unix]
|
|
script_runner="@shell"
|
|
script='''
|
|
rm -rf libafl_unix_shmem_server || true
|
|
mkdir in || true
|
|
echo a > in/a
|
|
./${FUZZER_NAME} -o out -i in
|
|
'''
|
|
dependencies = ["fuzzer"]
|
|
|
|
|
|
# Test
|
|
[tasks.test]
|
|
linux_alias = "test_unix"
|
|
mac_alias = "test_unix"
|
|
windows_alias = "unsupported"
|
|
|
|
[tasks.test_unix]
|
|
script_runner="@shell"
|
|
script='''
|
|
rm -rf libafl_unix_shmem_server || true
|
|
mkdir in || true
|
|
echo a > in/a
|
|
# Allow sigterm as exit code
|
|
timeout 11s ./${FUZZER_NAME} -o out -i in || [ $? -eq 124 ]
|
|
rm -rf out || true
|
|
rm -rf in || true
|
|
'''
|
|
dependencies = ["fuzzer"]
|
|
|
|
# Clean
|
|
[tasks.clean]
|
|
linux_alias = "clean_unix"
|
|
mac_alias = "clean_unix"
|
|
windows_alias = "unsupported"
|
|
|
|
[tasks.clean_unix]
|
|
script_runner="@shell"
|
|
script='''
|
|
rm ./${FUZZER_NAME} || true
|
|
rm fuzz.o || true
|
|
''' |