1 |
commit: 955dc1dcf97b4bd2bb0a3ff7726118798c261947 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jan 28 05:51:48 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jan 28 05:51:48 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=955dc1dc |
7 |
|
8 |
app-forensics/aflplusplus: add 4.00c |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
app-forensics/aflplusplus/Manifest | 1 + |
13 |
app-forensics/aflplusplus/aflplusplus-4.00c.ebuild | 93 ++++++++++++++++ |
14 |
...lplusplus-4.00c-no-ignore-errors-makefile.patch | 121 ++++++++++++++++++++ |
15 |
.../files/aflplusplus-4.00c-respect-flags.patch | 122 +++++++++++++++++++++ |
16 |
4 files changed, 337 insertions(+) |
17 |
|
18 |
diff --git a/app-forensics/aflplusplus/Manifest b/app-forensics/aflplusplus/Manifest |
19 |
index b03d0a638510..c3eed8c10f4b 100644 |
20 |
--- a/app-forensics/aflplusplus/Manifest |
21 |
+++ b/app-forensics/aflplusplus/Manifest |
22 |
@@ -1 +1,2 @@ |
23 |
DIST aflplusplus-3.14c.tar.gz 2162934 BLAKE2B 0830b320cea65b9bdd048a08a388c7145164f6b7f4dc140a2f4268a3aa22dc608a771169c830e2196e7a0d543e6f3da49f39736f3b2514c559b986ce929d43c4 SHA512 318607cff40b5f2fc94938747e2ac6b8f400767138eb39edf4daf320afbdab417d0d97a80a1c9db8bb557ad4b7b62f887ae6e692c376f5d5673a493bd23bb811 |
24 |
+DIST aflplusplus-4.00c.tar.gz 2805041 BLAKE2B c1ce15aa9860fc02a7d6f608cae9dd8987b72253b465ea734c721d1b6927e482c31b907aeafe82c00618465227e2e140bfc595151ea5d73037638c3ee630872c SHA512 23a7a4260e581f7c212393e1e14704464bbbc3ff5465b3472db31c6c7f2cd25a9ecc5ad81fad8958c775fcd01b22269085e6c69419a07fbbdb9ec317a3e39beb |
25 |
|
26 |
diff --git a/app-forensics/aflplusplus/aflplusplus-4.00c.ebuild b/app-forensics/aflplusplus/aflplusplus-4.00c.ebuild |
27 |
new file mode 100644 |
28 |
index 000000000000..8f04bfb0de1b |
29 |
--- /dev/null |
30 |
+++ b/app-forensics/aflplusplus/aflplusplus-4.00c.ebuild |
31 |
@@ -0,0 +1,93 @@ |
32 |
+# Copyright 1999-2022 Gentoo Authors |
33 |
+# Distributed under the terms of the GNU General Public License v2 |
34 |
+ |
35 |
+EAPI=7 |
36 |
+ |
37 |
+PYTHON_COMPAT=( python3_{8,9,10} ) |
38 |
+LLVM_MAX_SLOT=13 |
39 |
+inherit toolchain-funcs llvm optfeature python-single-r1 |
40 |
+ |
41 |
+DESCRIPTION="A fork of AFL, the popular compile-time instrumentation fuzzer" |
42 |
+HOMEPAGE="https://github.com/AFLplusplus/AFLplusplus" |
43 |
+SRC_URI="https://github.com/AFLplusplus/AFLplusplus/archive/${PV}.tar.gz -> ${P}.tar.gz" |
44 |
+S="${WORKDIR}/AFLplusplus-${PV}" |
45 |
+ |
46 |
+LICENSE="Apache-2.0" |
47 |
+SLOT="0" |
48 |
+KEYWORDS="~amd64 ~arm64" |
49 |
+IUSE="test" |
50 |
+ |
51 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
52 |
+ |
53 |
+# Tests involve heavy use of LD_PRELOAD in some cases |
54 |
+# This isn't compatible with sandbox |
55 |
+RESTRICT="test" |
56 |
+ |
57 |
+# It turns out we need Clang too |
58 |
+RDEPEND=" |
59 |
+ ${PYTHON_DEPS} |
60 |
+ >=sys-devel/llvm-10:= |
61 |
+ || ( |
62 |
+ sys-devel/clang:10 |
63 |
+ sys-devel/clang:11 |
64 |
+ sys-devel/clang:12 |
65 |
+ sys-devel/clang:13 |
66 |
+ ) |
67 |
+ !app-forensics/afl |
68 |
+" |
69 |
+DEPEND=" |
70 |
+ ${RDEPEND} |
71 |
+ test? ( dev-util/cmocka ) |
72 |
+" |
73 |
+ |
74 |
+QA_PREBUILT="/usr/share/afl/testcases/others/elf/small_exec.elf" |
75 |
+ |
76 |
+PATCHES=( |
77 |
+ "${FILESDIR}"/${PN}-4.00c-respect-flags.patch |
78 |
+ "${FILESDIR}"/${PN}-4.00c-no-ignore-errors-makefile.patch |
79 |
+) |
80 |
+ |
81 |
+llvm_check_deps() { |
82 |
+ has_version -b "sys-devel/clang:${LLVM_SLOT}" && \ |
83 |
+ has_version -b "sys-devel/llvm:${LLVM_SLOT}" |
84 |
+} |
85 |
+ |
86 |
+pkg_setup() { |
87 |
+ llvm_pkg_setup |
88 |
+ python-single-r1_pkg_setup |
89 |
+} |
90 |
+ |
91 |
+src_compile() { |
92 |
+ emake \ |
93 |
+ CC="$(tc-getCC)" \ |
94 |
+ CXX="$(tc-getCXX)" \ |
95 |
+ CFLAGS_FLTO="" \ |
96 |
+ PREFIX="${EPREFIX}/usr" \ |
97 |
+ HELPER_PATH="${EPREFIX}/usr/$(get_libdir)/afl" \ |
98 |
+ DOC_PATH="${EPREFIX}/usr/share/doc/${PF}" \ |
99 |
+ MAN_PATH="${EPREFIX}/usr/share/man/man8" |
100 |
+} |
101 |
+ |
102 |
+src_test() { |
103 |
+ emake \ |
104 |
+ CC="$(tc-getCC)" \ |
105 |
+ CXX="$(tc-getCXX)" |
106 |
+} |
107 |
+ |
108 |
+src_install() { |
109 |
+ emake \ |
110 |
+ CC="$(tc-getCC)" \ |
111 |
+ CXX="$(tc-getCXX)" \ |
112 |
+ DESTDIR="${D}" \ |
113 |
+ PREFIX="${EPREFIX}/usr" \ |
114 |
+ HELPER_PATH="${EPREFIX}/usr/$(get_libdir)/afl" \ |
115 |
+ DOC_PATH="${EPREFIX}/usr/share/doc/${PF}" \ |
116 |
+ MAN_PATH="${EPREFIX}/usr/share/man/man8" \ |
117 |
+ install |
118 |
+} |
119 |
+ |
120 |
+pkg_postinst() { |
121 |
+ # TODO: Any others? |
122 |
+ optfeature "fuzzing with AFL_USE_ASAN" sys-libs/compiler-rt-sanitizers[asan] |
123 |
+ optfeature "fuzzing with AFL_USE_MSAN" sys-libs/compiler-rt-sanitizers[msan] |
124 |
+} |
125 |
|
126 |
diff --git a/app-forensics/aflplusplus/files/aflplusplus-4.00c-no-ignore-errors-makefile.patch b/app-forensics/aflplusplus/files/aflplusplus-4.00c-no-ignore-errors-makefile.patch |
127 |
new file mode 100644 |
128 |
index 000000000000..50d9268ac9bb |
129 |
--- /dev/null |
130 |
+++ b/app-forensics/aflplusplus/files/aflplusplus-4.00c-no-ignore-errors-makefile.patch |
131 |
@@ -0,0 +1,121 @@ |
132 |
+https://bugs.gentoo.org/800941 |
133 |
+ |
134 |
+--- a/GNUmakefile |
135 |
++++ b/GNUmakefile |
136 |
+@@ -310,13 +310,13 @@ all: test_x86 test_shm test_python ready $(PROGS) afl-as llvm gcc_plugin test_bu |
137 |
+ |
138 |
+ .PHONY: llvm |
139 |
+ llvm: |
140 |
+- -$(MAKE) -j4 -f GNUmakefile.llvm |
141 |
++ $(MAKE) -j4 -f GNUmakefile.llvm |
142 |
+ @test -e afl-cc || { echo "[-] Compiling afl-cc failed. You seem not to have a working compiler." ; exit 1; } |
143 |
+ |
144 |
+ .PHONY: gcc_plugin |
145 |
+ gcc_plugin: |
146 |
+ ifneq "$(SYS)" "Darwin" |
147 |
+- -$(MAKE) -f GNUmakefile.gcc_plugin |
148 |
++ $(MAKE) -f GNUmakefile.gcc_plugin |
149 |
+ endif |
150 |
+ |
151 |
+ .PHONY: man |
152 |
+@@ -565,19 +565,19 @@ all_done: test_build |
153 |
+ .PHONY: clean |
154 |
+ clean: |
155 |
+ rm -rf $(PROGS) afl-fuzz-document afl-as as afl-g++ afl-clang afl-clang++ *.o src/*.o *~ a.out core core.[1-9][0-9]* *.stackdump .test .test1 .test2 test-instr .test-instr0 .test-instr1 afl-cs-proxy afl-qemu-trace afl-gcc-fast afl-g++-fast ld *.so *.8 test/unittests/*.o test/unittests/unit_maybe_alloc test/unittests/preallocable .afl-* afl-gcc afl-g++ afl-clang afl-clang++ test/unittests/unit_hash test/unittests/unit_rand *.dSYM |
156 |
+- -$(MAKE) -f GNUmakefile.llvm clean |
157 |
+- -$(MAKE) -f GNUmakefile.gcc_plugin clean |
158 |
+- -$(MAKE) -C utils/libdislocator clean |
159 |
+- -$(MAKE) -C utils/libtokencap clean |
160 |
++ $(MAKE) -f GNUmakefile.llvm clean |
161 |
++ $(MAKE) -f GNUmakefile.gcc_plugin clean |
162 |
++ $(MAKE) -C utils/libdislocator clean |
163 |
++ $(MAKE) -C utils/libtokencap clean |
164 |
+ $(MAKE) -C utils/aflpp_driver clean |
165 |
+- -$(MAKE) -C utils/afl_network_proxy clean |
166 |
+- -$(MAKE) -C utils/socket_fuzzing clean |
167 |
+- -$(MAKE) -C utils/argv_fuzzing clean |
168 |
+- -$(MAKE) -C utils/plot_ui clean |
169 |
+- -$(MAKE) -C qemu_mode/unsigaction clean |
170 |
+- -$(MAKE) -C qemu_mode/libcompcov clean |
171 |
+- -$(MAKE) -C qemu_mode/libqasan clean |
172 |
+- -$(MAKE) -C frida_mode clean |
173 |
++ $(MAKE) -C utils/afl_network_proxy clean |
174 |
++ $(MAKE) -C utils/socket_fuzzing clean |
175 |
++ $(MAKE) -C utils/argv_fuzzing clean |
176 |
++ $(MAKE) -C utils/plot_ui clean |
177 |
++ $(MAKE) -C qemu_mode/unsigaction clean |
178 |
++ $(MAKE) -C qemu_mode/libcompcov clean |
179 |
++ $(MAKE) -C qemu_mode/libqasan clean |
180 |
++ $(MAKE) -C frida_mode clean |
181 |
+ rm -rf nyx_mode/packer/linux_initramfs/init.cpio.gz nyx_mode/libnyx/libnyx/target/release/* nyx_mode/QEMU-Nyx/x86_64-softmmu/qemu-system-x86_64 |
182 |
+ ifeq "$(IN_REPO)" "1" |
183 |
+ -test -e coresight_mode/coresight-trace/Makefile && $(MAKE) -C coresight_mode/coresight-trace clean || true |
184 |
+@@ -607,20 +607,20 @@ endif |
185 |
+ |
186 |
+ .PHONY: distrib |
187 |
+ distrib: all |
188 |
+- -$(MAKE) -j4 -f GNUmakefile.llvm |
189 |
++ $(MAKE) -j4 -f GNUmakefile.llvm |
190 |
+ ifneq "$(SYS)" "Darwin" |
191 |
+- -$(MAKE) -f GNUmakefile.gcc_plugin |
192 |
++ $(MAKE) -f GNUmakefile.gcc_plugin |
193 |
+ endif |
194 |
+- -$(MAKE) -C utils/libdislocator |
195 |
+- -$(MAKE) -C utils/libtokencap |
196 |
+- -$(MAKE) -C utils/afl_network_proxy |
197 |
+- -$(MAKE) -C utils/socket_fuzzing |
198 |
+- -$(MAKE) -C utils/argv_fuzzing |
199 |
++ $(MAKE) -C utils/libdislocator |
200 |
++ $(MAKE) -C utils/libtokencap |
201 |
++ $(MAKE) -C utils/afl_network_proxy |
202 |
++ $(MAKE) -C utils/socket_fuzzing |
203 |
++ $(MAKE) -C utils/argv_fuzzing |
204 |
+ # -$(MAKE) -C utils/plot_ui |
205 |
+- -$(MAKE) -C frida_mode |
206 |
++ $(MAKE) -C frida_mode |
207 |
+ ifneq "$(SYS)" "Darwin" |
208 |
+ ifeq "$(ARCH)" "aarch64" |
209 |
+- -$(MAKE) -C coresight_mode |
210 |
++ $(MAKE) -C coresight_mode |
211 |
+ endif |
212 |
+ ifeq "$(SYS)" "Linux" |
213 |
+ -cd nyx_mode && ./build_nyx_support.sh |
214 |
+@@ -651,12 +651,12 @@ endif |
215 |
+ |
216 |
+ .PHONY: source-only |
217 |
+ source-only: all |
218 |
+- -$(MAKE) -j4 -f GNUmakefile.llvm |
219 |
++ $(MAKE) -j4 -f GNUmakefile.llvm |
220 |
+ ifneq "$(SYS)" "Darwin" |
221 |
+- -$(MAKE) -f GNUmakefile.gcc_plugin |
222 |
++ $(MAKE) -f GNUmakefile.gcc_plugin |
223 |
+ endif |
224 |
+- -$(MAKE) -C utils/libdislocator |
225 |
+- -$(MAKE) -C utils/libtokencap |
226 |
++ $(MAKE) -C utils/libdislocator |
227 |
++ $(MAKE) -C utils/libtokencap |
228 |
+ # -$(MAKE) -C utils/plot_ui |
229 |
+ ifeq "$(SYS)" "Linux" |
230 |
+ -cd nyx_mode && ./build_nyx_support.sh |
231 |
+@@ -702,9 +702,9 @@ install: all $(MANPAGES) |
232 |
+ @if [ -f utils/afl_network_proxy/afl-network-server ]; then $(MAKE) -C utils/afl_network_proxy install; fi |
233 |
+ @if [ -f utils/aflpp_driver/libAFLDriver.a ]; then set -e; install -m 644 utils/aflpp_driver/libAFLDriver.a $${DESTDIR}$(HELPER_PATH); fi |
234 |
+ @if [ -f utils/aflpp_driver/libAFLQemuDriver.a ]; then set -e; install -m 644 utils/aflpp_driver/libAFLQemuDriver.a $${DESTDIR}$(HELPER_PATH); fi |
235 |
+- -$(MAKE) -f GNUmakefile.llvm install |
236 |
++ $(MAKE) -f GNUmakefile.llvm install |
237 |
+ ifneq "$(SYS)" "Darwin" |
238 |
+- -$(MAKE) -f GNUmakefile.gcc_plugin install |
239 |
++ $(MAKE) -f GNUmakefile.gcc_plugin install |
240 |
+ endif |
241 |
+ ln -sf afl-cc $${DESTDIR}$(BIN_PATH)/afl-gcc |
242 |
+ ln -sf afl-cc $${DESTDIR}$(BIN_PATH)/afl-g++ |
243 |
+--- a/GNUmakefile.llvm |
244 |
++++ b/GNUmakefile.llvm |
245 |
+@@ -457,6 +457,7 @@ document: |
246 |
+ test_build: $(PROGS) |
247 |
+ @echo "[*] Testing the CC wrapper and instrumentation output..." |
248 |
+ 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) |
249 |
++ @test -e test-instr || { echo "[-] Testing CC wrapper failed. You seem not to have a working compiler." ; exit 1; } |
250 |
+ ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr0 ./test-instr < /dev/null |
251 |
+ echo 1 | ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr1 ./test-instr |
252 |
+ @rm -f test-instr |
253 |
|
254 |
diff --git a/app-forensics/aflplusplus/files/aflplusplus-4.00c-respect-flags.patch b/app-forensics/aflplusplus/files/aflplusplus-4.00c-respect-flags.patch |
255 |
new file mode 100644 |
256 |
index 000000000000..47ccbe008c89 |
257 |
--- /dev/null |
258 |
+++ b/app-forensics/aflplusplus/files/aflplusplus-4.00c-respect-flags.patch |
259 |
@@ -0,0 +1,122 @@ |
260 |
+--- a/GNUmakefile |
261 |
++++ b/GNUmakefile |
262 |
+@@ -420,7 +420,7 @@ afl-as: src/afl-as.c include/afl-as.h $(COMM_HDR) | test_x86 |
263 |
+ @ln -sf afl-as as |
264 |
+ |
265 |
+ src/afl-performance.o : $(COMM_HDR) src/afl-performance.c include/hash.h |
266 |
+- $(CC) $(CFLAGS) -Iinclude $(SPECIAL_PERFORMANCE) -O3 -fno-unroll-loops -c src/afl-performance.c -o src/afl-performance.o |
267 |
++ $(CC) $(CFLAGS) -Iinclude $(SPECIAL_PERFORMANCE) -fno-unroll-loops -c src/afl-performance.c -o src/afl-performance.o |
268 |
+ |
269 |
+ src/afl-common.o : $(COMM_HDR) src/afl-common.c include/common.h |
270 |
+ $(CC) $(CFLAGS) $(CFLAGS_FLTO) -c src/afl-common.c -o src/afl-common.o |
271 |
+--- a/GNUmakefile.gcc_plugin |
272 |
++++ b/GNUmakefile.gcc_plugin |
273 |
+@@ -131,18 +131,18 @@ afl-common.o: ./src/afl-common.c |
274 |
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ $(LDFLAGS) |
275 |
+ |
276 |
+ ./afl-compiler-rt.o: instrumentation/afl-compiler-rt.o.c |
277 |
+- $(CC) $(CFLAGS_SAFE) $(CPPFLAGS) -O3 -Wno-unused-result -fPIC -c $< -o $@ |
278 |
++ $(CC) $(CFLAGS) $(CFLAGS_SAFE) $(CPPFLAGS) -Wno-unused-result -fPIC -c $< -o $@ |
279 |
+ |
280 |
+ ./afl-compiler-rt-32.o: instrumentation/afl-compiler-rt.o.c |
281 |
+ @printf "[*] Building 32-bit variant of the runtime (-m32)... " |
282 |
+- @$(CC) $(CFLAGS_SAFE) $(CPPFLAGS) -O3 -Wno-unused-result -m32 -fPIC -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; ln -sf afl-compiler-rt-32.o afl-llvm-rt-32.o; else echo "failed (that's fine)"; fi |
283 |
++ @$(CC) $(CFLAGS) $(CFLAGS_SAFE) $(CPPFLAGS) -Wno-unused-result -m32 -fPIC -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; ln -sf afl-compiler-rt-32.o afl-llvm-rt-32.o; else echo "failed (that's fine)"; fi |
284 |
+ |
285 |
+ ./afl-compiler-rt-64.o: instrumentation/afl-compiler-rt.o.c |
286 |
+ @printf "[*] Building 64-bit variant of the runtime (-m64)... " |
287 |
+- @$(CC) $(CFLAGS_SAFE) $(CPPFLAGS) -O3 -Wno-unused-result -m64 -fPIC -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; ln -sf afl-compiler-rt-64.o afl-llvm-rt-64.o; else echo "failed (that's fine)"; fi |
288 |
++ @$(CC) $(CFLAGS) $(CFLAGS_SAFE) $(CPPFLAGS) -Wno-unused-result -m64 -fPIC -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; ln -sf afl-compiler-rt-64.o afl-llvm-rt-64.o; else echo "failed (that's fine)"; fi |
289 |
+ |
290 |
+ ./afl-gcc-pass.so: instrumentation/afl-gcc-pass.so.cc | test_deps |
291 |
+- $(CXX) $(CXXEFLAGS) $(PLUGIN_FLAGS) -shared $< -o $@ |
292 |
++ $(CXX) $(CXXEFLAGS) $(PLUGIN_FLAGS) -shared $< -o $@ $(LDFLAGS) |
293 |
+ ln -sf afl-cc afl-gcc-fast |
294 |
+ ln -sf afl-cc afl-g++-fast |
295 |
+ ln -sf afl-cc.8 afl-gcc-fast.8 |
296 |
+--- a/GNUmakefile.llvm |
297 |
++++ b/GNUmakefile.llvm |
298 |
+@@ -438,20 +438,20 @@ afl-llvm-dict2file.so: instrumentation/afl-llvm-dict2file.so.cc instrumentation/ |
299 |
+ |
300 |
+ .PHONY: document |
301 |
+ document: |
302 |
+- $(CLANG_BIN) -D_AFL_DOCUMENT_MUTATIONS $(CFLAGS_SAFE) $(CPPFLAGS) $(CLANG_CFL) -O3 -Wno-unused-result -fPIC -c instrumentation/afl-compiler-rt.o.c -o ./afl-compiler-rt.o |
303 |
+- @$(CLANG_BIN) -D_AFL_DOCUMENT_MUTATIONS $(CFLAGS_SAFE) $(CPPFLAGS) $(CLANG_CFL) -O3 -Wno-unused-result -m32 -fPIC -c instrumentation/afl-compiler-rt.o.c -o ./afl-compiler-rt-32.o 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; else echo "failed (that's fine)"; fi |
304 |
+- @$(CLANG_BIN) -D_AFL_DOCUMENT_MUTATIONS $(CFLAGS_SAFE) $(CPPFLAGS) $(CLANG_CFL) -O3 -Wno-unused-result -m64 -fPIC -c instrumentation/afl-compiler-rt.o.c -o ./afl-compiler-rt-64.o 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; else echo "failed (that's fine)"; fi |
305 |
++ $(CLANG_BIN) -D_AFL_DOCUMENT_MUTATIONS $(CFLAGS) $(CFLAGS_SAFE) $(CPPFLAGS) $(CLANG_CFL) -Wno-unused-result -fPIC -c instrumentation/afl-compiler-rt.o.c -o ./afl-compiler-rt.o |
306 |
++ @$(CLANG_BIN) -D_AFL_DOCUMENT_MUTATIONS $(CFLAGS) $(CFLAGS_SAFE) $(CPPFLAGS) $(CLANG_CFL) -Wno-unused-result -m32 -fPIC -c instrumentation/afl-compiler-rt.o.c -o ./afl-compiler-rt-32.o 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; else echo "failed (that's fine)"; fi |
307 |
++ @$(CLANG_BIN) -D_AFL_DOCUMENT_MUTATIONS $(CFLAGS) $(CFLAGS_SAFE) $(CPPFLAGS) $(CLANG_CFL) -Wno-unused-result -m64 -fPIC -c instrumentation/afl-compiler-rt.o.c -o ./afl-compiler-rt-64.o 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; else echo "failed (that's fine)"; fi |
308 |
+ |
309 |
+ ./afl-compiler-rt.o: instrumentation/afl-compiler-rt.o.c |
310 |
+- $(CC) $(CLANG_CFL) $(CFLAGS_SAFE) $(CPPFLAGS) -O3 -Wno-unused-result -fPIC -c $< -o $@ |
311 |
++ $(CC) $(CFLAGS) $(CLANG_CFL) $(CFLAGS_SAFE) $(CPPFLAGS) -Wno-unused-result -fPIC -c $< -o $@ |
312 |
+ |
313 |
+ ./afl-compiler-rt-32.o: instrumentation/afl-compiler-rt.o.c |
314 |
+ @printf "[*] Building 32-bit variant of the runtime (-m32)... " |
315 |
+- @$(CC) $(CLANG_CFL) $(CFLAGS_SAFE) $(CPPFLAGS) -O3 -Wno-unused-result -m32 -fPIC -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; ln -sf afl-compiler-rt-32.o afl-llvm-rt-32.o; else echo "failed (that's fine)"; fi |
316 |
++ @$(CC) $(CFLAGS) $(CLANG_CFL) $(CFLAGS_SAFE) $(CPPFLAGS) -Wno-unused-result -m32 -fPIC -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; ln -sf afl-compiler-rt-32.o afl-llvm-rt-32.o; else echo "failed (that's fine)"; fi |
317 |
+ |
318 |
+ ./afl-compiler-rt-64.o: instrumentation/afl-compiler-rt.o.c |
319 |
+ @printf "[*] Building 64-bit variant of the runtime (-m64)... " |
320 |
+- @$(CC) $(CLANG_CFL) $(CFLAGS_SAFE) $(CPPFLAGS) -O3 -Wno-unused-result -m64 -fPIC -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; ln -sf afl-compiler-rt-64.o afl-llvm-rt-64.o; else echo "failed (that's fine)"; fi |
321 |
++ @$(CC) $(CFLAGS) $(CLANG_CFL) $(CFLAGS_SAFE) $(CPPFLAGS) -Wno-unused-result -m64 -fPIC -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; ln -sf afl-compiler-rt-64.o afl-llvm-rt-64.o; else echo "failed (that's fine)"; fi |
322 |
+ |
323 |
+ .PHONY: test_build |
324 |
+ test_build: $(PROGS) |
325 |
+--- a/custom_mutators/honggfuzz/Makefile |
326 |
++++ b/custom_mutators/honggfuzz/Makefile |
327 |
+@@ -1,5 +1,6 @@ |
328 |
+ |
329 |
+-CFLAGS = -O3 -funroll-loops -fPIC -Wl,-Bsymbolic |
330 |
++CFLAGS ?= -O3 |
331 |
++CFLAGS += -funroll-loops -fPIC -Wl,-Bsymbolic |
332 |
+ |
333 |
+ all: honggfuzz-mutator.so |
334 |
+ |
335 |
+--- a/custom_mutators/libfuzzer/Makefile |
336 |
++++ b/custom_mutators/libfuzzer/Makefile |
337 |
+@@ -1,5 +1,6 @@ |
338 |
+ |
339 |
+-CFLAGS = -g -O3 -funroll-loops -fPIC -fpermissive -std=c++11 |
340 |
++CFLAGS ?= -g -O3 |
341 |
++CFLAGS += -funroll-loops -fpermissive -std=c++11 -fPIC |
342 |
+ #CFLAGS = -g -O0 -fPIC -fpermissive -std=c++11 |
343 |
+ CXX ?= clang++ |
344 |
+ |
345 |
+--- a/frida_mode/GNUmakefile |
346 |
++++ b/frida_mode/GNUmakefile |
347 |
+@@ -17,7 +17,6 @@ CFLAGS+=-fPIC \ |
348 |
+ -D_GNU_SOURCE \ |
349 |
+ -D_FORTIFY_SOURCE=2 \ |
350 |
+ -g \ |
351 |
+- -O3 \ |
352 |
+ -funroll-loops \ |
353 |
+ -ffunction-sections \ |
354 |
+ |
355 |
+--- a/frida_mode/test/png/persistent/hook/GNUmakefile |
356 |
++++ b/frida_mode/test/png/persistent/hook/GNUmakefile |
357 |
+@@ -5,11 +5,9 @@ BUILD_DIR:=$(PWD)build/ |
358 |
+ AFLPP_FRIDA_DRIVER_HOOK_OBJ=$(ROOT)frida_mode/build/frida_hook.so |
359 |
+ AFLPP_QEMU_DRIVER_HOOK_OBJ=$(ROOT)frida_mode/build/qemu_hook.so |
360 |
+ |
361 |
+-CFLAGS+=-O3 \ |
362 |
+- -funroll-loops \ |
363 |
++CFLAGS+= -funroll-loops \ |
364 |
+ -g \ |
365 |
+- -fPIC \ |
366 |
+- -funroll-loops \ |
367 |
++ -fPIC |
368 |
+ |
369 |
+ LDFLAGS+=-shared \ |
370 |
+ |
371 |
+--- a/utils/aflpp_driver/GNUmakefile |
372 |
++++ b/utils/aflpp_driver/GNUmakefile |
373 |
+@@ -7,7 +7,7 @@ ifneq "" "$(LLVM_BINDIR)" |
374 |
+ LLVM_BINDIR := $(LLVM_BINDIR)/ |
375 |
+ endif |
376 |
+ |
377 |
+-CFLAGS := -O3 -funroll-loops -g -fPIC |
378 |
++CFLAGS ?= -O3 -funroll-loops -g -fPIC |
379 |
+ |
380 |
+ all: libAFLDriver.a libAFLQemuDriver.a aflpp_qemu_driver_hook.so |
381 |
+ |