diff options
author | hexcoder- <heiko@hexco.de> | 2020-12-12 11:21:13 +0100 |
---|---|---|
committer | hexcoder- <heiko@hexco.de> | 2020-12-12 11:21:13 +0100 |
commit | 54f59c7403502aa3be73bf860b08c38ae5a64bfa (patch) | |
tree | 26429d21643b030611a9c23cf0dcb755d8aef60f /GNUmakefile | |
parent | dbbbeea36ee6d5bd0e317c3389a7e3ad1cd1b2b1 (diff) | |
download | AFLplusplus-54f59c7403502aa3be73bf860b08c38ae5a64bfa.tar.gz |
add an extra test for afl-gcc and check for -B support
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/GNUmakefile b/GNUmakefile index 3585543a..4d71e9fb 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -510,15 +510,25 @@ code-format: .PHONY: test_build ifndef AFL_NO_X86 -test_build: afl-cc afl-as afl-showmap - @echo "[*] Testing the CC wrapper and instrumentation output..." +test_build: afl-cc afl-gcc afl-as afl-showmap + @echo "[*] Testing the CC wrapper afl-cc and its instrumentation output..." @unset AFL_MAP_SIZE AFL_USE_UBSAN AFL_USE_CFISAN AFL_USE_ASAN AFL_USE_MSAN AFL_CC; AFL_INST_RATIO=100 AFL_PATH=. ./afl-cc test-instr.c -o test-instr 2>&1 || (echo "Oops, afl-cc failed"; exit 1 ) ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr0 ./test-instr < /dev/null echo 1 | ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr1 ./test-instr @rm -f test-instr - @cmp -s .test-instr0 .test-instr1; DR="$$?"; rm -f .test-instr0 .test-instr1; if [ "$$DR" = "0" ]; then echo; echo "Oops, the instrumentation does not seem to be behaving correctly!"; echo; echo "Please post to https://github.com/AFLplusplus/AFLplusplus/issues to troubleshoot the issue."; echo; exit 1; fi + @cmp -s .test-instr0 .test-instr1; DR="$$?"; rm -f .test-instr0 .test-instr1; if [ "$$DR" = "0" ]; then echo; echo "Oops, the instrumentation of afl-cc does not seem to be behaving correctly!"; echo; echo "Please post to https://github.com/AFLplusplus/AFLplusplus/issues to troubleshoot the issue."; echo; exit 1; fi + @echo + @echo "[+] All right, the instrumentation of afl-cc seems to be working!" + @echo "[*] Testing the CC wrapper afl-gcc and its instrumentation output..." + @unset AFL_MAP_SIZE AFL_USE_UBSAN AFL_USE_CFISAN AFL_USE_ASAN AFL_USE_MSAN AFL_CC; AFL_INST_RATIO=100 AFL_PATH=. ./afl-gcc test-instr.c -o test-instr 2>&1 || (echo "Oops, afl-gcc failed"; exit 1 ) + ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr0 ./test-instr < /dev/null + echo 1 | ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr1 ./test-instr + @rm -f test-instr + @cmp -s .test-instr0 .test-instr1; DR="$$?"; rm -f .test-instr0 .test-instr1; if [ "$$DR" = "0" ]; then echo; echo "Oops, the instrumentation of afl-gcc does not seem to be behaving correctly!"; \ + gcc -v 2>&1 | grep -q -- --with-as= && ( echo; echo "Gcc is configured not to use an external assembler with the -B option."; echo "See docs/INSTALL.md section 5 how to build a -B enabled gcc." ) || \ + ( echo; echo "Please post to https://github.com/AFLplusplus/AFLplusplus/issues to troubleshoot the issue." ); echo; exit 1; fi @echo - @echo "[+] All right, the instrumentation seems to be working!" + @echo "[+] All right, the instrumentation of afl-gcc seems to be working!" else test_build: afl-cc afl-as afl-showmap @echo "[!] Note: skipping build tests (you may need to use LLVM or QEMU mode)." |