Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-forensics/aflplusplus/files/
Date: Mon, 04 Jul 2022 23:24:23
Message-Id: 1656977040.0a69da48bddc8566105c52fe6f23cfbabb615bc7.sam@gentoo
1 commit: 0a69da48bddc8566105c52fe6f23cfbabb615bc7
2 Author: Alexander Miller <alex.miller <AT> gmx <DOT> de>
3 AuthorDate: Mon Jul 4 16:31:44 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 4 23:24:00 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0a69da48
7
8 app-forensics/aflplusplus: Don't use *FLAGS when testing CC wrappers
9
10 The flags used to build the package could be incompatible with the wrapper
11 due to gcc vs. clang differences. Doesn't affect installed files.
12
13 Signed-off-by: Alexander Miller <alex.miller <AT> gmx.de>
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 ...flplusplus-4.01c-no-ignore-errors-makefile.patch | 2 +-
17 .../files/aflplusplus-4.01c-respect-flags.patch | 21 ++++++++++++++++++++-
18 2 files changed, 21 insertions(+), 2 deletions(-)
19
20 diff --git a/app-forensics/aflplusplus/files/aflplusplus-4.01c-no-ignore-errors-makefile.patch b/app-forensics/aflplusplus/files/aflplusplus-4.01c-no-ignore-errors-makefile.patch
21 index 95718bb3a32d..8a78e7d791d8 100644
22 --- a/app-forensics/aflplusplus/files/aflplusplus-4.01c-no-ignore-errors-makefile.patch
23 +++ b/app-forensics/aflplusplus/files/aflplusplus-4.01c-no-ignore-errors-makefile.patch
24 @@ -147,7 +147,7 @@ https://bugs.gentoo.org/800941
25 @@ -463,6 +463,7 @@ document:
26 test_build: $(PROGS)
27 @echo "[*] Testing the CC wrapper and instrumentation output..."
28 - unset AFL_USE_ASAN AFL_USE_MSAN AFL_INST_RATIO; ASAN_OPTIONS=detect_leaks=0 AFL_QUIET=1 AFL_PATH=. AFL_LLVM_LAF_ALL=1 ./afl-cc $(CFLAGS) $(CPPFLAGS) ./test-instr.c -o test-instr $(LDFLAGS)
29 + unset AFL_USE_ASAN AFL_USE_MSAN AFL_INST_RATIO; ASAN_OPTIONS=detect_leaks=0 AFL_QUIET=1 AFL_PATH=. AFL_LLVM_LAF_ALL=1 ./afl-cc ./test-instr.c -o test-instr
30 + @test -e test-instr || { echo "[-] Testing CC wrapper failed. You seem not to have a working compiler." ; exit 1; }
31 ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr0 ./test-instr < /dev/null
32 echo 1 | ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr1 ./test-instr
33
34 diff --git a/app-forensics/aflplusplus/files/aflplusplus-4.01c-respect-flags.patch b/app-forensics/aflplusplus/files/aflplusplus-4.01c-respect-flags.patch
35 index d22d582ecaa9..e4d56c25095e 100644
36 --- a/app-forensics/aflplusplus/files/aflplusplus-4.01c-respect-flags.patch
37 +++ b/app-forensics/aflplusplus/files/aflplusplus-4.01c-respect-flags.patch
38 @@ -1,3 +1,7 @@
39 +* Respect CFLAGS everywhere when building.
40 +* Ignore build flags then when testing the CC wrappers (could contain
41 + incompatible flags).
42 +
43 --- a/GNUmakefile
44 +++ b/GNUmakefile
45 @@ -423,7 +423,7 @@ afl-as: src/afl-as.c include/afl-as.h $(COMM_HDR) | test_x86
46 @@ -9,6 +13,15 @@
47
48 src/afl-common.o : $(COMM_HDR) src/afl-common.c include/common.h
49 $(CC) $(CFLAGS) $(CFLAGS_FLTO) -c src/afl-common.c -o src/afl-common.o
50 +@@ -531,7 +531,7 @@ .PHONY: test_build
51 + ifndef AFL_NO_X86
52 + test_build: afl-cc afl-gcc afl-as afl-showmap
53 + @echo "[*] Testing the CC wrapper afl-cc and its instrumentation output..."
54 +- @unset AFL_MAP_SIZE AFL_USE_UBSAN AFL_USE_CFISAN AFL_USE_LSAN AFL_USE_ASAN AFL_USE_MSAN; ASAN_OPTIONS=detect_leaks=0 AFL_INST_RATIO=100 AFL_PATH=. ./afl-cc test-instr.c $(LDFLAGS) -o test-instr 2>&1 || (echo "Oops, afl-cc failed"; exit 1 )
55 ++ @unset AFL_MAP_SIZE AFL_USE_UBSAN AFL_USE_CFISAN AFL_USE_LSAN AFL_USE_ASAN AFL_USE_MSAN; ASAN_OPTIONS=detect_leaks=0 AFL_INST_RATIO=100 AFL_PATH=. ./afl-cc test-instr.c -o test-instr 2>&1 || (echo "Oops, afl-cc failed"; exit 1 )
56 + ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr0 ./test-instr < /dev/null
57 + echo 1 | ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr1 ./test-instr
58 + @rm -f test-instr
59 --- a/GNUmakefile.gcc_plugin
60 +++ b/GNUmakefile.gcc_plugin
61 @@ -131,18 +131,18 @@ afl-common.o: ./src/afl-common.c
62 @@ -36,7 +49,7 @@
63 ln -sf afl-cc.8 afl-gcc-fast.8
64 --- a/GNUmakefile.llvm
65 +++ b/GNUmakefile.llvm
66 -@@ -444,20 +444,20 @@ afl-llvm-dict2file.so: instrumentation/afl-llvm-dict2file.so.cc instrumentation/
67 +@@ -444,25 +444,25 @@ afl-llvm-dict2file.so: instrumentation/afl-llvm-dict2file.so.cc instrumentation/
68
69 .PHONY: document
70 document:
71 @@ -63,6 +76,12 @@
72
73 .PHONY: test_build
74 test_build: $(PROGS)
75 + @echo "[*] Testing the CC wrapper and instrumentation output..."
76 +- unset AFL_USE_ASAN AFL_USE_MSAN AFL_INST_RATIO; ASAN_OPTIONS=detect_leaks=0 AFL_QUIET=1 AFL_PATH=. AFL_LLVM_LAF_ALL=1 ./afl-cc $(CFLAGS) $(CPPFLAGS) ./test-instr.c -o test-instr $(LDFLAGS)
77 ++ unset AFL_USE_ASAN AFL_USE_MSAN AFL_INST_RATIO; ASAN_OPTIONS=detect_leaks=0 AFL_QUIET=1 AFL_PATH=. AFL_LLVM_LAF_ALL=1 ./afl-cc ./test-instr.c -o test-instr
78 + ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr0 ./test-instr < /dev/null
79 + echo 1 | ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr1 ./test-instr
80 + @rm -f test-instr
81 --- a/custom_mutators/honggfuzz/Makefile
82 +++ b/custom_mutators/honggfuzz/Makefile
83 @@ -1,5 +1,6 @@