From 3f0d642f9b31ea6afeb4e27aa24eddc27ad36fa1 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Sat, 26 Mar 2022 19:13:49 +0000 Subject: fix unicornafl test --- test/test-unicorn-mode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/test-unicorn-mode.sh b/test/test-unicorn-mode.sh index 182958d6..f8ff4190 100755 --- a/test/test-unicorn-mode.sh +++ b/test/test-unicorn-mode.sh @@ -3,7 +3,7 @@ . ./test-pre.sh $ECHO "$BLUE[*] Testing: unicorn_mode" -test -d ../unicorn_mode/unicornafl -a -e ../unicorn_mode/unicornafl/samples/shellcode && { +test -d ../unicorn_mode/unicornafl -a -e ../unicorn_mode/unicornafl/Makefile && { test -e ../unicorn_mode/samples/python_simple/simple_target.bin -a -e ../unicorn_mode/samples/compcov_x64/compcov_target.bin && { { # We want to see python errors etc. in logs, in case something doesn't work -- cgit 1.4.1 From b34751efbf9304128d8e52dfeeb3abe0d4f5ba3b Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Tue, 29 Mar 2022 10:34:08 +0200 Subject: fix qemu sigunaction tests --- qemu_mode/unsigaction/Makefile | 14 +++++++------- test/test-qemu-mode.sh | 14 ++++---------- unicorn_mode/build_unicorn_support.sh | 4 +++- 3 files changed, 14 insertions(+), 18 deletions(-) (limited to 'test') diff --git a/qemu_mode/unsigaction/Makefile b/qemu_mode/unsigaction/Makefile index eabe6c77..f026a2b7 100644 --- a/qemu_mode/unsigaction/Makefile +++ b/qemu_mode/unsigaction/Makefile @@ -12,19 +12,19 @@ # # http://www.apache.org/licenses/LICENSE-2.0 # -.POSIX: -_UNIQ=_QINU_ - -TARGETCANDIDATES=unsigaction.so -_TARGETS=$(_UNIQ)$(AFL_NO_X86)$(_UNIQ) -__TARGETS=$(_TARGETS:$(_UNIQ)1$(_UNIQ)=) -TARGETS=$(__TARGETS:$(_UNIQ)$(_UNIQ)=$(TARGETCANDIDATES)) +TARGETS=unsigaction.so unsigaction32.so unsigaction64.so all: $(TARGETS) unsigaction.so: unsigaction.c @if $(CC) -fPIC -shared unsigaction.c -o unsigaction.so 2>/dev/null ; then echo "unsigaction build success"; else echo "unsigaction build failure (that's fine)"; fi +unsigaction32.so: unsigaction.c + @if $(CC) -fPIC -m32 -shared unsigaction.c -o unsigaction32.so 2>/dev/null ; then echo "unsigaction32 build success"; else echo "unsigaction32 build failure (that's fine)"; fi + +unsigaction64.so: unsigaction.c + @if $(CC) -fPIC -m64 -shared unsigaction.c -o unsigaction64.so 2>/dev/null ; then echo "unsigaction64 build success"; else echo "unsigaction64 build failure (that's fine)"; fi + clean: rm -f unsigaction.so diff --git a/test/test-qemu-mode.sh b/test/test-qemu-mode.sh index 85578d55..46b138ff 100755 --- a/test/test-qemu-mode.sh +++ b/test/test-qemu-mode.sh @@ -165,11 +165,8 @@ test -e ../afl-qemu-trace && { CODE=1 } } || { - echo CUT------------------------------------------------------------------CUT - cat errors - echo CUT------------------------------------------------------------------CUT - $ECHO "$RED[!] cannot compile test program (32 bit) for unsigaction library" - CODE=1 + $ECHO "$YELLOW[-] cannot compile test program (32 bit) for unsigaction library" + INCOMPLETE=1 } } || { $ECHO "$YELLOW[-] we cannot test qemu_mode unsigaction library (32 bit) because it is not present" @@ -194,11 +191,8 @@ test -e ../afl-qemu-trace && { } unset LD_PRELOAD } || { - echo CUT------------------------------------------------------------------CUT - cat errors - echo CUT------------------------------------------------------------------CUT - $ECHO "$RED[!] cannot compile test program (64 bit) for unsigaction library" - CODE=1 + $ECHO "$YELLOW[-] cannot compile test program (64 bit) for unsigaction library" + INCOMPLETE=1 } } || { $ECHO "$YELLOW[-] we cannot test qemu_mode unsigaction library (64 bit) because it is not present" diff --git a/unicorn_mode/build_unicorn_support.sh b/unicorn_mode/build_unicorn_support.sh index a846fd1c..0f8c5e8c 100755 --- a/unicorn_mode/build_unicorn_support.sh +++ b/unicorn_mode/build_unicorn_support.sh @@ -217,7 +217,9 @@ cd ../samples/python_simple || echo "Cannot cd" # Run afl-showmap on the sample application. If anything comes out then it must have worked! unset AFL_INST_RATIO -echo 0 | ../../../afl-showmap -U -m none -t 2000 -q -o ./.test-instr0 -- $PYTHONBIN ./simple_test_harness.py ./sample_inputs/sample1.bin || echo "Showmap" +pwd +echo "echo 0 | ../../../afl-showmap -U -m none -t 2000 -o ./.test-instr0 -- $PYTHONBIN ./simple_test_harness.py ./sample_inputs/sample1.bin" +echo 0 | ../../../afl-showmap -U -m none -t 2000 -o ./.test-instr0 -- $PYTHONBIN ./simple_test_harness.py ./sample_inputs/sample1.bin || echo "Showmap" if [ -s ./.test-instr0 ] then -- cgit 1.4.1 From a436ef47e5cf0cb16b4afddccc6530285a6bb6fa Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Wed, 30 Mar 2022 09:16:47 +0200 Subject: fix instrumentlist for LTO with clang < 13 --- src/afl-cc.c | 2 ++ test/test-llvm-lto.sh | 3 +++ 2 files changed, 5 insertions(+) (limited to 'test') diff --git a/src/afl-cc.c b/src/afl-cc.c index dfcb2a89..4cec7740 100644 --- a/src/afl-cc.c +++ b/src/afl-cc.c @@ -577,6 +577,8 @@ static void edit_params(u32 argc, char **argv, char **envp) { #if defined(AFL_CLANG_LDPATH) && LLVM_MAJOR >= 13 cc_params[cc_par_cnt++] = "-Wl,--lto-legacy-pass-manager"; +#else + cc_params[cc_par_cnt++] = "-fno-experimental-new-pass-manager"; #endif cc_params[cc_par_cnt++] = "-Wl,--allow-multiple-definition"; diff --git a/test/test-llvm-lto.sh b/test/test-llvm-lto.sh index 9ff2ec10..bb4a9f7c 100755 --- a/test/test-llvm-lto.sh +++ b/test/test-llvm-lto.sh @@ -49,6 +49,9 @@ test -e ../afl-clang-lto -a -e ../SanitizerCoverageLTO.so && { grep -q "No instrumentation targets found" test.out && { $ECHO "$GREEN[+] llvm_mode LTO instrumentlist feature works correctly" } || { + echo CUT------------------------------------------------------------------CUT + cat test.out + echo CUT------------------------------------------------------------------CUT $ECHO "$RED[!] llvm_mode LTO instrumentlist feature failed" CODE=1 } -- cgit 1.4.1