From b93a5bb41473def5b9328704e2b14636147b85ee Mon Sep 17 00:00:00 2001 From: mkravchik Date: Wed, 10 Jan 2024 14:17:53 +0200 Subject: [PATCH] Pr/fix qemu launcher build - fixes 1785 (#1786) * Fixing qemu_launcher build (#1785) * Fixed the instructions for using the injection feature --- fuzzers/qemu_launcher/Makefile.toml | 1 + fuzzers/qemu_launcher/README.md | 2 +- fuzzers/qemu_launcher/injection_test/Makefile | 4 ++-- fuzzers/qemu_launcher/injection_test/README.md | 7 ++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/fuzzers/qemu_launcher/Makefile.toml b/fuzzers/qemu_launcher/Makefile.toml index a8b9613766..e4f0e1eac3 100644 --- a/fuzzers/qemu_launcher/Makefile.toml +++ b/fuzzers/qemu_launcher/Makefile.toml @@ -211,6 +211,7 @@ ${CROSS_CXX} \ "${TARGET_DIR}/build-png/.libs/libpng16.a" \ "${TARGET_DIR}/build-zlib/libz.a" \ -I"${TARGET_DIR}/build-png" \ + -I"${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/libpng-1.6.37" \ -I"${TARGET_DIR}/build-zlib/zlib/lib" \ -L"${TARGET_DIR}/build-zlib/zlib/lib" \ -o"${TARGET_DIR}/libpng-harness-${CARGO_MAKE_PROFILE}" \ diff --git a/fuzzers/qemu_launcher/README.md b/fuzzers/qemu_launcher/README.md index a173b5a2f8..10111d6471 100644 --- a/fuzzers/qemu_launcher/README.md +++ b/fuzzers/qemu_launcher/README.md @@ -11,7 +11,7 @@ The following architectures are supported: * mips * ppc -Note that the injection feature `-y` is currently only supported on x86_64 +Note that the injection feature `-j` is currently only supported on x86_64 and aarch64. ## Prerequisites diff --git a/fuzzers/qemu_launcher/injection_test/Makefile b/fuzzers/qemu_launcher/injection_test/Makefile index d566aa2899..bccae7e826 100644 --- a/fuzzers/qemu_launcher/injection_test/Makefile +++ b/fuzzers/qemu_launcher/injection_test/Makefile @@ -1,10 +1,10 @@ all: static sqltest sqltest: sqltest.c - gcc -g -o sqltest sqltest.c -l sqlite3 -lm + gcc -g -o sqltest sqltest.c -l sqlite3 -lm -lpthread static: sqltest.c - gcc -g -o static sqltest.c -l sqlite3 -lm -static + gcc -g -o static sqltest.c -l sqlite3 -lm -static -lpthread -ldl fuzz: sqltest.c afl-clang-fast -o fuzz sqltest.c -l sqlite3 diff --git a/fuzzers/qemu_launcher/injection_test/README.md b/fuzzers/qemu_launcher/injection_test/README.md index 30ca9be958..dc7b622a0a 100644 --- a/fuzzers/qemu_launcher/injection_test/README.md +++ b/fuzzers/qemu_launcher/injection_test/README.md @@ -1,3 +1,8 @@ +## Prerequisites +```bash +sudo apt install libsqlite3-dev +``` + # Injection test setup To build the injection test target: @@ -6,5 +11,5 @@ To build the injection test target: To run qemu_launcher with the injection detection activated: ``` -target/release/qemu_launcher -y injections.yaml -i in -o out -- injection_test/static +target/x86_64/release/qemu_launcher -j injections.yaml -i in -o out -- injection_test/static ```