summaryrefslogtreecommitdiff
path: root/app-forensics/aflplusplus
diff options
context:
space:
mode:
Diffstat (limited to 'app-forensics/aflplusplus')
-rw-r--r--app-forensics/aflplusplus/Manifest7
-rw-r--r--app-forensics/aflplusplus/aflplusplus-4.01c-r1.ebuild90
-rw-r--r--app-forensics/aflplusplus/aflplusplus-4.05c.ebuild2
-rw-r--r--app-forensics/aflplusplus/files/aflplusplus-4.01c-lld-detect.patch14
-rw-r--r--app-forensics/aflplusplus/files/aflplusplus-4.01c-no-ignore-errors-makefile.patch155
-rw-r--r--app-forensics/aflplusplus/files/aflplusplus-4.01c-respect-flags.patch197
6 files changed, 2 insertions, 463 deletions
diff --git a/app-forensics/aflplusplus/Manifest b/app-forensics/aflplusplus/Manifest
index 91ebd7412e5d..984862cfe8a5 100644
--- a/app-forensics/aflplusplus/Manifest
+++ b/app-forensics/aflplusplus/Manifest
@@ -1,15 +1,10 @@
-AUX aflplusplus-4.01c-lld-detect.patch 516 BLAKE2B 44b32508dc04aee377eda714ec95e8fd149b6175376e9c7b64c1376dc3f09d5aa84366ec4788d7b5943925a537f359d62f608035388446766180c07ecfa87538 SHA512 0730a65448031f17e3afb6b0ed9760280483f2a07882900c66b6b40be4440fa73e2ccc077410f15472da809c447b864421a431ffe98b4eccd1e6b30a4028398b
-AUX aflplusplus-4.01c-no-ignore-errors-makefile.patch 5840 BLAKE2B a895ef0956539978c9f3f9c128149d6573e0f7750de9086bd9890f45b43bc76e934e0d0768b30d6a60832f931c351b060b772e9816f551191e8c90a29906af1b SHA512 0ad93eaad1da1472be6f402514c2fde832abbcfcf11e1350ea58109fe5c49f53a018e2c1d516714f3aab2e9917384e9bfae91630033476b295b023800a301b03
-AUX aflplusplus-4.01c-respect-flags.patch 11669 BLAKE2B 1aa396a2283fd8b8efb40086c555155256c248be8b72aeaa64b1f9d439d669a5ac95bbf0286f76bfd235d189532d230505533030d6710d42c5d4132728093c5b SHA512 acdaad1e1a30e1e19f05823c15ecd459bd38bdcbcca21b3b9a953d29d7540136d7e4cd92d88836dce8d588f70d19d66756bdf61c0fa6e268d53926a6a1bdf13f
-DIST aflplusplus-4.01c.tar.gz 2818445 BLAKE2B f3699c4b2fabec0ab238277c3b2c7b19b35af7a0b82b14a57c34b8579121cfa0644ef432132cf4a3382547db3faf799d2ab601512ddfb469e4a2246cdb61aa7f SHA512 d2b03ab4ff9538fe0b52aa3ed4778a6e5657d64d6f0e5f75a99305bad69c5179d6b1c882650f19a884a740577acb73dab7cee3d5c9c7b06ff2326ffeba37d1fe
DIST aflplusplus-4.03c-patches.tar.xz 4444 BLAKE2B 4eed2ee97e4f7aef987e5c931469b7bb1d85310cb101878e5e71431ac36329a07b0e05812ed1e743c6ed3ce76e10c4392f2bf7ccc98ec1537b75196c5629acfe SHA512 bcaa196640f47923be6daa65e3c5f8461eadaec3b939f2cfe0223eacc64be385c80166ec7dc0df25d0c38053a38c3efcfbc25d8387bed5c54c95a8781ed64b00
DIST aflplusplus-4.03c.tar.gz 2830718 BLAKE2B 1b55daf3c3a0a0b11c1ef0a7dd1005cfa1ec61fb54691b96519f57788233b1385b52948468f2d5beada3c58129bc0524f07aebfb25ee8cef1e5d5afd06b1233d SHA512 4bab00d964eb9d0664d97062f5da8090dfef599480f25b04d08b84e7f47676a9790fb23573f7e885b5da6ab813694f9ab26a0b5c9d341834892530558e3b83ef
DIST aflplusplus-4.04c-patches.tar.xz 4236 BLAKE2B 86bb5d1e0da271833fc548633e08897bd681f1b575b3131d72222eeb7135f3cbdbd5580d0afc56a23639eb4621f878fd4ffdc4e0ba11b34388a99768f2529c76 SHA512 5c607b255e2d74033d5258218a907a8edcd44eab006377edee9618d3755815fbda9f5d565444e090ab0b27220675736a1eed285f92cb74122d0b9b3bcbcc0a2c
DIST aflplusplus-4.04c.tar.gz 2832011 BLAKE2B 80a5652b0d64b4824c3b4f91bf993a8499a0c86cf878ca83c7b7afe217cc1603700d4cf7408ae40f1435251153f88e0663cabe470a06387e6664249b3a015172 SHA512 1c2e2e6677e87de2f069e1acdc2319580e488670c3d4975a0f0807da33965c4a14087a7c734195d0a47260acc91f7211b10bd905aac99bdab81145b282edb44e
DIST aflplusplus-4.05c-patches.tar.xz 4860 BLAKE2B dcc0bf2799393bb7e27c6592cf46efc19277733ae1e17b3ab5b7a60aed244ec24405ceaecb5f310ac344390a92b4348275e8a19936b8760c0f2fe74f086771b9 SHA512 7a475f433796d9b9c13c5755a11aa632174662d18e69add6531fe1cbe42d75ad514bc779e42630b0a48c9df9edcc89fe992f654812fa2281b6ffa64a1019c82c
DIST aflplusplus-4.05c.tar.gz 2839704 BLAKE2B 31594e5c41cb057a1598a112e158360a172a512756a2cba2ec9bd78643045945c9a0f378e322c9250e75a6348b76f5cc84d8de6560e0a6a92a19f4d4b9a149eb SHA512 cb07279e4b1b2fa48a455acd551e26d9a53cf585258880aba4f26aa147b748b947b0608e5bbec4212362da3efc20183ba90b2dfa6584df93861dcca269d5ea7c
-EBUILD aflplusplus-4.01c-r1.ebuild 2167 BLAKE2B cdf3a3e1bd5222426d0841693c262ea8406f21fcbd16f1518b5c15d04b72c31957e57b519b47be1002c1966b8ad64ab41a6cfde91f7dc1c168a5563b041fa5a7 SHA512 8f9d43230632d9d6df1ea420f79fed527da24f6660e189324b2ac99250c5f6a64488c23601f24721225515977e943117025bb0fa91b1e907d267e56b1f7b357f
EBUILD aflplusplus-4.03c.ebuild 2058 BLAKE2B 627a29e84353cd26b266e7f5a0f413a1b0ad8ce9c884c94f289dcec78e1e2e8a8829b746ea271fb0fa6c0369bea9aa7d9b5cde63b158956bcc772783ee6e2e8a SHA512 329f60a78dcc297009b0b2f68ad664822b37b4bac4b8f7ec42dbd84744c33a7556ed04a4e4a04366f3890e671faf18eb9c9ff1db2c853cf0f9e0b00a55354911
EBUILD aflplusplus-4.04c-r1.ebuild 2081 BLAKE2B db6987f54b96263faf6fc8089e656e3bde8c9d1c21b67e182e106e52bccb8878238916a3c5bcd98882757ac12d1183898ac303ed503265f21bfffe313c326977 SHA512 ffffa6cced5350167689f06e817dc9f331445bde1bfa159473f481bfb4502d1718503552ad8cab72fd55a06366a2f4776f4530548879f726ad60dc0b83548d87
-EBUILD aflplusplus-4.05c.ebuild 2081 BLAKE2B 19a74e09cb60ee706db54fa00967c58ab8a471090867d85361438f93296f5eede7ecd2bcf22e81bf4c1b4fe5b6ee841ae898b84c5a5e90fa8578e3c657118449 SHA512 a52c21b74ea2fec280420ee0b4a1054cc1400a830ddf0a1d4c6ed0262af7078a93a6a553c52feb5ad7362f2ce0ff4c533fa09770f0459c3397ef592e92f1071c
+EBUILD aflplusplus-4.05c.ebuild 2081 BLAKE2B 6a40a09875f1a938f7719cd2f5db402f4cb80b9b72a0c94154b7ecff69ab30ee9932de2c39f5f1f8eca9bad41d20c4d7022b8b2da7e853323ffac0254c00f644 SHA512 405e9f0e52004c12fb414b56e4bfb20592032dfd3e043cbfc42b22dc9f2e149cdba4d23ccb6a47472c512e39058a9a92780e942acccd9d69d455bf7624e2bf27
MISC metadata.xml 328 BLAKE2B c9ad582740e9c2ad03a30fe0eaafb8ee19f0d9bc2e98cc7bcd14385a3407f84301479d324b92d3aecafdc1e5cfef1d2cfc8a15c2ecb5d8f2fa348d82de920128 SHA512 e56ce158f6764926c2ed4dc486f017ce75fa272ac8e6ad16e4a816f8c734d7313e3dc9cb007bab07efe73e59cab185312a02d6178296bfe25002719ce4975d14
diff --git a/app-forensics/aflplusplus/aflplusplus-4.01c-r1.ebuild b/app-forensics/aflplusplus/aflplusplus-4.01c-r1.ebuild
deleted file mode 100644
index 098797d09e10..000000000000
--- a/app-forensics/aflplusplus/aflplusplus-4.01c-r1.ebuild
+++ /dev/null
@@ -1,90 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{8,9,10} )
-LLVM_MAX_SLOT=14
-inherit toolchain-funcs llvm optfeature python-single-r1
-
-DESCRIPTION="A fork of AFL, the popular compile-time instrumentation fuzzer"
-HOMEPAGE="https://github.com/AFLplusplus/AFLplusplus"
-SRC_URI="https://github.com/AFLplusplus/AFLplusplus/archive/${PV}.tar.gz -> ${P}.tar.gz"
-S="${WORKDIR}/AFLplusplus-${PV}"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-KEYWORDS="amd64 arm64"
-IUSE="test"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-# Tests involve heavy use of LD_PRELOAD in some cases
-# This isn't compatible with sandbox
-RESTRICT="test"
-
-# It turns out we need Clang too
-RDEPEND="${PYTHON_DEPS}
- >=sys-devel/llvm-12:=
- || (
- sys-devel/clang:12
- sys-devel/clang:13
- sys-devel/clang:${LLVM_MAX_SLOT}
- )
- !app-forensics/afl"
-DEPEND="${RDEPEND}
- test? ( dev-util/cmocka )"
-
-QA_PREBUILT="usr/share/afl/testcases/others/elf/small_exec.elf"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-4.01c-respect-flags.patch
- "${FILESDIR}"/${PN}-4.01c-no-ignore-errors-makefile.patch
- "${FILESDIR}"/${PN}-4.01c-lld-detect.patch
-)
-
-llvm_check_deps() {
- has_version -b "sys-devel/clang:${LLVM_SLOT}" && \
- has_version -b "sys-devel/llvm:${LLVM_SLOT}"
-}
-
-pkg_setup() {
- llvm_pkg_setup
- python-single-r1_pkg_setup
-}
-
-src_compile() {
- emake \
- CC="$(tc-getCC)" \
- CXX="$(tc-getCXX)" \
- CFLAGS_FLTO="" \
- PREFIX="${EPREFIX}/usr" \
- HELPER_PATH="${EPREFIX}/usr/$(get_libdir)/afl" \
- DOC_PATH="${EPREFIX}/usr/share/doc/${PF}" \
- MAN_PATH="${EPREFIX}/usr/share/man/man8"
-}
-
-src_test() {
- emake \
- CC="$(tc-getCC)" \
- CXX="$(tc-getCXX)"
-}
-
-src_install() {
- emake \
- CC="$(tc-getCC)" \
- CXX="$(tc-getCXX)" \
- DESTDIR="${D}" \
- PREFIX="${EPREFIX}/usr" \
- HELPER_PATH="${EPREFIX}/usr/$(get_libdir)/afl" \
- DOC_PATH="${EPREFIX}/usr/share/doc/${PF}" \
- MAN_PATH="${EPREFIX}/usr/share/man/man8" \
- install
- dostrip -x /usr/share/afl/testcases/
-}
-
-pkg_postinst() {
- # TODO: Any others?
- optfeature "fuzzing with AFL_USE_ASAN" sys-libs/compiler-rt-sanitizers[asan]
- optfeature "fuzzing with AFL_USE_MSAN" sys-libs/compiler-rt-sanitizers[msan]
-}
diff --git a/app-forensics/aflplusplus/aflplusplus-4.05c.ebuild b/app-forensics/aflplusplus/aflplusplus-4.05c.ebuild
index eac16abd0282..3be15a8fa0d8 100644
--- a/app-forensics/aflplusplus/aflplusplus-4.05c.ebuild
+++ b/app-forensics/aflplusplus/aflplusplus-4.05c.ebuild
@@ -3,7 +3,7 @@
EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
+PYTHON_COMPAT=( python3_{8..11} )
LLVM_MAX_SLOT=15
inherit toolchain-funcs llvm optfeature python-single-r1
diff --git a/app-forensics/aflplusplus/files/aflplusplus-4.01c-lld-detect.patch b/app-forensics/aflplusplus/files/aflplusplus-4.01c-lld-detect.patch
deleted file mode 100644
index cec2c9d17979..000000000000
--- a/app-forensics/aflplusplus/files/aflplusplus-4.01c-lld-detect.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/GNUmakefile.llvm
-+++ b/GNUmakefile.llvm
-@@ -218,9 +218,8 @@ endif
- ifeq "$(LLVM_LTO)" "1"
- ifneq "$(AFL_CLANG_FLTO)" ""
- ifeq "$(AFL_REAL_LD)" ""
-- ifneq "$(shell readlink $(LLVM_BINDIR)/ld.lld 2>&1)" ""
-- AFL_REAL_LD = $(LLVM_BINDIR)/ld.lld
-- else
-+ AFL_REAL_LD = "$(shell command -v $(LLVM_BINDIR)/ld.lld 2>/dev/null || command -v ld.lld 2>/dev/null)"
-+ ifeq "$(AFL_REAL_LD)" ""
- $(warning ld.lld not found, cannot enable LTO mode)
- LLVM_LTO = 0
- endif
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
deleted file mode 100644
index 861835892bb5..000000000000
--- a/app-forensics/aflplusplus/files/aflplusplus-4.01c-no-ignore-errors-makefile.patch
+++ /dev/null
@@ -1,155 +0,0 @@
-https://bugs.gentoo.org/800941
-(also don't override jobs for sub-makes)
-
---- a/GNUmakefile
-+++ b/GNUmakefile
-@@ -308,17 +308,17 @@ endif
-
- .PHONY: all
- all: test_x86 test_shm test_python ready $(PROGS) afl-as llvm gcc_plugin test_build all_done
-- -$(MAKE) -C utils/aflpp_driver
-+ $(MAKE) -C utils/aflpp_driver
-
- .PHONY: llvm
- llvm:
-- -$(MAKE) -j4 -f GNUmakefile.llvm
-+ $(MAKE) -f GNUmakefile.llvm
- @test -e afl-cc || { echo "[-] Compiling afl-cc failed. You seem not to have a working compiler." ; exit 1; }
-
- .PHONY: gcc_plugin
- gcc_plugin:
- ifneq "$(SYS)" "Darwin"
-- -$(MAKE) -f GNUmakefile.gcc_plugin
-+ $(MAKE) -f GNUmakefile.gcc_plugin
- endif
-
- .PHONY: man
-@@ -568,19 +568,19 @@ all_done: test_build
- .PHONY: clean
- clean:
- 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 lib*.a
-- -$(MAKE) -f GNUmakefile.llvm clean
-- -$(MAKE) -f GNUmakefile.gcc_plugin clean
-- -$(MAKE) -C utils/libdislocator clean
-- -$(MAKE) -C utils/libtokencap clean
-+ $(MAKE) -f GNUmakefile.llvm clean
-+ $(MAKE) -f GNUmakefile.gcc_plugin clean
-+ $(MAKE) -C utils/libdislocator clean
-+ $(MAKE) -C utils/libtokencap clean
- $(MAKE) -C utils/aflpp_driver clean
-- -$(MAKE) -C utils/afl_network_proxy clean
-- -$(MAKE) -C utils/socket_fuzzing clean
-- -$(MAKE) -C utils/argv_fuzzing clean
-- -$(MAKE) -C utils/plot_ui clean
-- -$(MAKE) -C qemu_mode/unsigaction clean
-- -$(MAKE) -C qemu_mode/libcompcov clean
-- -$(MAKE) -C qemu_mode/libqasan clean
-- -$(MAKE) -C frida_mode clean
-+ $(MAKE) -C utils/afl_network_proxy clean
-+ $(MAKE) -C utils/socket_fuzzing clean
-+ $(MAKE) -C utils/argv_fuzzing clean
-+ $(MAKE) -C utils/plot_ui clean
-+ $(MAKE) -C qemu_mode/unsigaction clean
-+ $(MAKE) -C qemu_mode/libcompcov clean
-+ $(MAKE) -C qemu_mode/libqasan clean
-+ $(MAKE) -C frida_mode clean
- 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
- ifeq "$(IN_REPO)" "1"
- -test -e coresight_mode/coresight-trace/Makefile && $(MAKE) -C coresight_mode/coresight-trace clean || true
-@@ -610,20 +610,20 @@ endif
-
- .PHONY: distrib
- distrib: all
-- -$(MAKE) -j4 -f GNUmakefile.llvm
-+ $(MAKE) -f GNUmakefile.llvm
- ifneq "$(SYS)" "Darwin"
-- -$(MAKE) -f GNUmakefile.gcc_plugin
-+ $(MAKE) -f GNUmakefile.gcc_plugin
- endif
-- -$(MAKE) -C utils/libdislocator
-- -$(MAKE) -C utils/libtokencap
-- -$(MAKE) -C utils/afl_network_proxy
-- -$(MAKE) -C utils/socket_fuzzing
-- -$(MAKE) -C utils/argv_fuzzing
-- # -$(MAKE) -C utils/plot_ui
-- -$(MAKE) -C frida_mode
-+ $(MAKE) -C utils/libdislocator
-+ $(MAKE) -C utils/libtokencap
-+ $(MAKE) -C utils/afl_network_proxy
-+ $(MAKE) -C utils/socket_fuzzing
-+ $(MAKE) -C utils/argv_fuzzing
-+ # $(MAKE) -C utils/plot_ui
-+ $(MAKE) -C frida_mode
- ifneq "$(SYS)" "Darwin"
- ifeq "$(ARCH)" "aarch64"
-- -$(MAKE) -C coresight_mode
-+ $(MAKE) -C coresight_mode
- endif
- ifeq "$(SYS)" "Linux"
- ifndef NO_NYX
-@@ -636,16 +636,16 @@ endif
-
- .PHONY: binary-only
- binary-only: test_shm test_python ready $(PROGS)
-- -$(MAKE) -C utils/libdislocator
-- -$(MAKE) -C utils/libtokencap
-- -$(MAKE) -C utils/afl_network_proxy
-- -$(MAKE) -C utils/socket_fuzzing
-- -$(MAKE) -C utils/argv_fuzzing
-- # -$(MAKE) -C utils/plot_ui
-- -$(MAKE) -C frida_mode
-+ $(MAKE) -C utils/libdislocator
-+ $(MAKE) -C utils/libtokencap
-+ $(MAKE) -C utils/afl_network_proxy
-+ $(MAKE) -C utils/socket_fuzzing
-+ $(MAKE) -C utils/argv_fuzzing
-+ # $(MAKE) -C utils/plot_ui
-+ $(MAKE) -C frida_mode
- ifneq "$(SYS)" "Darwin"
- ifeq "$(ARCH)" "aarch64"
-- -$(MAKE) -C coresight_mode
-+ $(MAKE) -C coresight_mode
- endif
- ifeq "$(SYS)" "Linux"
- ifndef NO_NYX
-@@ -658,13 +658,13 @@ endif
-
- .PHONY: source-only
- source-only: all
-- -$(MAKE) -j4 -f GNUmakefile.llvm
-+ $(MAKE) -f GNUmakefile.llvm
- ifneq "$(SYS)" "Darwin"
-- -$(MAKE) -f GNUmakefile.gcc_plugin
-+ $(MAKE) -f GNUmakefile.gcc_plugin
- endif
-- -$(MAKE) -C utils/libdislocator
-- -$(MAKE) -C utils/libtokencap
-- # -$(MAKE) -C utils/plot_ui
-+ $(MAKE) -C utils/libdislocator
-+ $(MAKE) -C utils/libtokencap
-+ # $(MAKE) -C utils/plot_ui
- ifeq "$(SYS)" "Linux"
- ifndef NO_NYX
- -cd nyx_mode && ./build_nyx_support.sh
-@@ -712,9 +712,9 @@ install: all $(MANPAGES)
- @if [ -f utils/afl_network_proxy/afl-network-server ]; then $(MAKE) -C utils/afl_network_proxy install; fi
- @if [ -f utils/aflpp_driver/libAFLDriver.a ]; then set -e; install -m 644 utils/aflpp_driver/libAFLDriver.a $${DESTDIR}$(HELPER_PATH); fi
- @if [ -f utils/aflpp_driver/libAFLQemuDriver.a ]; then set -e; install -m 644 utils/aflpp_driver/libAFLQemuDriver.a $${DESTDIR}$(HELPER_PATH); fi
-- -$(MAKE) -f GNUmakefile.llvm install
-+ $(MAKE) -f GNUmakefile.llvm install
- ifneq "$(SYS)" "Darwin"
-- -$(MAKE) -f GNUmakefile.gcc_plugin install
-+ $(MAKE) -f GNUmakefile.gcc_plugin install
- endif
- ln -sf afl-cc $${DESTDIR}$(BIN_PATH)/afl-gcc
- ln -sf afl-cc $${DESTDIR}$(BIN_PATH)/afl-g++
---- a/GNUmakefile.llvm
-+++ b/GNUmakefile.llvm
-@@ -463,6 +463,7 @@ document:
- test_build: $(PROGS)
- @echo "[*] Testing the CC wrapper and instrumentation output..."
- 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
-+ @test -e test-instr || { echo "[-] Testing CC wrapper failed. You seem not to have a working compiler." ; 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
diff --git a/app-forensics/aflplusplus/files/aflplusplus-4.01c-respect-flags.patch b/app-forensics/aflplusplus/files/aflplusplus-4.01c-respect-flags.patch
deleted file mode 100644
index 0fe62c0b41ae..000000000000
--- a/app-forensics/aflplusplus/files/aflplusplus-4.01c-respect-flags.patch
+++ /dev/null
@@ -1,197 +0,0 @@
-* Respect AR, CC, CFLAGS, CPPFLAGS, LDFLAGS everywhere when building.
-* Ignore build flags then when testing the CC wrappers (could contain
- incompatible flags).
-* Disable LTO for runtime objects, these shouldn't contain IR.
-
---- a/GNUmakefile
-+++ b/GNUmakefile
-@@ -423,7 +423,7 @@ afl-as: src/afl-as.c include/afl-as.h $(COMM_HDR) | test_x86
- @ln -sf afl-as as
-
- src/afl-performance.o : $(COMM_HDR) src/afl-performance.c include/hash.h
-- $(CC) $(CFLAGS) $(CFLAGS_OPT) -Iinclude -c src/afl-performance.c -o src/afl-performance.o
-+ $(CC) $(CFLAGS) -Iinclude -c src/afl-performance.c -o src/afl-performance.o
-
- src/afl-common.o : $(COMM_HDR) src/afl-common.c include/common.h
- $(CC) $(CFLAGS) $(CFLAGS_FLTO) -c src/afl-common.c -o src/afl-common.o
-@@ -531,7 +531,7 @@ .PHONY: test_build
- ifndef AFL_NO_X86
- 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_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 )
-+ @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 )
- 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
---- a/GNUmakefile.gcc_plugin
-+++ b/GNUmakefile.gcc_plugin
-@@ -131,18 +131,18 @@ afl-common.o: ./src/afl-common.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ $(LDFLAGS)
-
- ./afl-compiler-rt.o: instrumentation/afl-compiler-rt.o.c
-- $(CC) $(CFLAGS_SAFE) $(CPPFLAGS) -O3 -Wno-unused-result -fPIC -c $< -o $@
-+ $(CC) $(CFLAGS) $(CFLAGS_SAFE) $(CPPFLAGS) -Wno-unused-result -fPIC -fno-lto -c $< -o $@
-
- ./afl-compiler-rt-32.o: instrumentation/afl-compiler-rt.o.c
- @printf "[*] Building 32-bit variant of the runtime (-m32)... "
-- @$(CC) $(CFLAGS_SAFE) $(CPPFLAGS) -O3 -Wno-unused-result -m32 -fPIC -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; else echo "failed (that's fine)"; fi
-+ @$(CC) $(CFLAGS) $(CFLAGS_SAFE) $(CPPFLAGS) -Wno-unused-result -m32 -fPIC -fno-lto -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; else echo "failed (that's fine)"; fi
-
- ./afl-compiler-rt-64.o: instrumentation/afl-compiler-rt.o.c
- @printf "[*] Building 64-bit variant of the runtime (-m64)... "
-- @$(CC) $(CFLAGS_SAFE) $(CPPFLAGS) -O3 -Wno-unused-result -m64 -fPIC -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; else echo "failed (that's fine)"; fi
-+ @$(CC) $(CFLAGS) $(CFLAGS_SAFE) $(CPPFLAGS) -Wno-unused-result -m64 -fPIC -fno-lto -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; else echo "failed (that's fine)"; fi
-
- ./afl-gcc-pass.so: instrumentation/afl-gcc-pass.so.cc | test_deps
-- $(CXX) $(CXXEFLAGS) $(PLUGIN_FLAGS) -shared $< -o $@
-+ $(CXX) $(CXXEFLAGS) $(PLUGIN_FLAGS) -shared $< -o $@ $(LDFLAGS)
- ln -sf afl-cc afl-gcc-fast
- ln -sf afl-cc afl-g++-fast
- ln -sf afl-cc.8 afl-gcc-fast.8
---- a/GNUmakefile.llvm
-+++ b/GNUmakefile.llvm
-@@ -410,7 +410,7 @@ endif
-
- ./afl-ld-lto: src/afl-ld-lto.c
- ifeq "$(LLVM_LTO)" "1"
-- $(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@
-+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@
- endif
-
- ./SanitizerCoverageLTO.so: instrumentation/SanitizerCoverageLTO.so.cc instrumentation/afl-llvm-common.o
-@@ -444,25 +444,25 @@ afl-llvm-dict2file.so: instrumentation/afl-llvm-dict2file.so.cc instrumentation/
-
- .PHONY: document
- document:
-- $(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
-- @$(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
-- @$(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
-+ $(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
-+ @$(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
-+ @$(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
-
- ./afl-compiler-rt.o: instrumentation/afl-compiler-rt.o.c
-- $(CC) $(CLANG_CFL) $(CFLAGS_SAFE) $(CPPFLAGS) -O3 -Wno-unused-result -fPIC -c $< -o $@
-+ $(CC) $(CFLAGS) $(CLANG_CFL) $(CFLAGS_SAFE) $(CPPFLAGS) -Wno-unused-result -fPIC -fno-lto -c $< -o $@
-
- ./afl-compiler-rt-32.o: instrumentation/afl-compiler-rt.o.c
- @printf "[*] Building 32-bit variant of the runtime (-m32)... "
-- @$(CC) $(CLANG_CFL) $(CFLAGS_SAFE) $(CPPFLAGS) -O3 -Wno-unused-result -m32 -fPIC -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; else echo "failed (that's fine)"; fi
-+ @$(CC) $(CFLAGS) $(CLANG_CFL) $(CFLAGS_SAFE) $(CPPFLAGS) -Wno-unused-result -m32 -fPIC -fno-lto -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; else echo "failed (that's fine)"; fi
-
- ./afl-compiler-rt-64.o: instrumentation/afl-compiler-rt.o.c
- @printf "[*] Building 64-bit variant of the runtime (-m64)... "
-- @$(CC) $(CLANG_CFL) $(CFLAGS_SAFE) $(CPPFLAGS) -O3 -Wno-unused-result -m64 -fPIC -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; else echo "failed (that's fine)"; fi
-+ @$(CC) $(CFLAGS) $(CLANG_CFL) $(CFLAGS_SAFE) $(CPPFLAGS) -Wno-unused-result -m64 -fPIC -fno-lto -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; else echo "failed (that's fine)"; fi
-
- .PHONY: test_build
- test_build: $(PROGS)
- @echo "[*] Testing the CC wrapper and instrumentation output..."
-- 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)
-+ 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
- 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
---- a/custom_mutators/honggfuzz/Makefile
-+++ b/custom_mutators/honggfuzz/Makefile
-@@ -1,5 +1,6 @@
-
--CFLAGS = -O3 -funroll-loops -fPIC -Wl,-Bsymbolic
-+CFLAGS ?= -O3
-+CFLAGS += -funroll-loops -fPIC -Wl,-Bsymbolic
-
- all: honggfuzz-mutator.so
-
---- a/custom_mutators/libfuzzer/Makefile
-+++ b/custom_mutators/libfuzzer/Makefile
-@@ -1,5 +1,5 @@
-
--CFLAGS = -g -O3 -funroll-loops -fPIC -fpermissive -std=c++11
--#CFLAGS = -g -O0 -fPIC -fpermissive -std=c++11
-+CFLAGS ?= -g -O3
-+CFLAGS += -funroll-loops -fpermissive -std=c++11 -fPIC
- CXX ?= clang++
-
---- a/frida_mode/GNUmakefile
-+++ b/frida_mode/GNUmakefile
-@@ -17,7 +17,6 @@ CFLAGS+=-fPIC \
- -D_GNU_SOURCE \
- -D_FORTIFY_SOURCE=2 \
- -g \
-- -O3 \
- -funroll-loops \
- -ffunction-sections \
-
---- a/frida_mode/test/png/persistent/hook/GNUmakefile
-+++ b/frida_mode/test/png/persistent/hook/GNUmakefile
-@@ -5,11 +5,9 @@ BUILD_DIR:=$(PWD)build/
- AFLPP_FRIDA_DRIVER_HOOK_OBJ=$(ROOT)frida_mode/build/frida_hook.so
- AFLPP_QEMU_DRIVER_HOOK_OBJ=$(ROOT)frida_mode/build/qemu_hook.so
-
--CFLAGS+=-O3 \
-- -funroll-loops \
-+CFLAGS+= -funroll-loops \
- -g \
-- -fPIC \
-- -funroll-loops \
-+ -fPIC
-
- LDFLAGS+=-shared \
-
---- a/utils/aflpp_driver/GNUmakefile
-+++ b/utils/aflpp_driver/GNUmakefile
-@@ -13,40 +13,42 @@ ifneq "" "$(LLVM_BINDIR)"
- LLVM_BINDIR := $(LLVM_BINDIR)/
- endif
-
--CFLAGS := -O3 -funroll-loops -g -fPIC
-+AR ?= ar
-+CFLAGS ?= -O3 -funroll-loops -g
-+CFLAGS += -fPIC -fno-lto
-
- all: libAFLDriver.a libAFLQemuDriver.a aflpp_qemu_driver_hook.so
-
- aflpp_driver.o: aflpp_driver.c
-- -$(LLVM_BINDIR)clang -I. -I../../include $(CFLAGS) -c aflpp_driver.c
-+ $(CC) $(CPPFLAGS) -I. -I../../include $(CFLAGS) -c aflpp_driver.c
-
- libAFLDriver.a: aflpp_driver.o
-- @ar rc libAFLDriver.a aflpp_driver.o
-+ $(AR) rc libAFLDriver.a aflpp_driver.o
- @cp -vf libAFLDriver.a ../../
-
- debug:
-- $(LLVM_BINDIR)clang -Wno-deprecated -I../../include $(CFLAGS) -D_DEBUG=\"1\" -c -o afl-performance.o ../../src/afl-performance.c
-- $(LLVM_BINDIR)clang -I../../include -D_DEBUG=\"1\" -g -funroll-loops -c aflpp_driver.c
-+ $(CC) $(CPPFLAGS) -Wno-deprecated -I../../include $(CFLAGS) -D_DEBUG=\"1\" -c -o afl-performance.o ../../src/afl-performance.c
-+ $(CC) $(CPPFLAGS) -I../../include -D_DEBUG=\"1\" $(CFLAGS) -g -funroll-loops -c aflpp_driver.c
- #$(LLVM_BINDIR)clang -S -emit-llvm -Wno-deprecated -I../../include $(CFLAGS) -D_DEBUG=\"1\" -c -o afl-performance.ll ../../src/afl-performance.c
- #$(LLVM_BINDIR)clang -S -emit-llvm -I../../include -D_DEBUG=\"1\" -g -funroll-loops -c aflpp_driver.c
-- ar rc libAFLDriver.a afl-performance.o aflpp_driver.o
-+ $(AR) rc libAFLDriver.a afl-performance.o aflpp_driver.o
-
- aflpp_qemu_driver.o: aflpp_qemu_driver.c
-- -$(LLVM_BINDIR)clang $(CFLAGS) -O0 -funroll-loops -c aflpp_qemu_driver.c
-+ $(CC) $(CPPFLAGS) $(CFLAGS) -O0 -funroll-loops -c aflpp_qemu_driver.c
-
- libAFLQemuDriver.a: aflpp_qemu_driver.o
-- @-ar rc libAFLQemuDriver.a aflpp_qemu_driver.o
-- @-cp -vf libAFLQemuDriver.a ../../
-+ $(AR) rc libAFLQemuDriver.a aflpp_qemu_driver.o
-+ @cp -vf libAFLQemuDriver.a ../../
-
- aflpp_qemu_driver_hook.so: aflpp_qemu_driver_hook.o
-- @-test -e aflpp_qemu_driver_hook.o && $(LLVM_BINDIR)clang $(LDFLAGS) -shared aflpp_qemu_driver_hook.o -o aflpp_qemu_driver_hook.so || echo "Note: Optional aflpp_qemu_driver_hook.so not built."
-+ @test -e aflpp_qemu_driver_hook.o && $(CC) $(LDFLAGS) -shared aflpp_qemu_driver_hook.o -o aflpp_qemu_driver_hook.so || echo "Note: Optional aflpp_qemu_driver_hook.so not built."
-
- aflpp_qemu_driver_hook.o: aflpp_qemu_driver_hook.c
-- @-test -e ../../qemu_mode/qemuafl/qemuafl/api.h && $(LLVM_BINDIR)clang $(CFLAGS) -funroll-loops -c aflpp_qemu_driver_hook.c || echo "Note: Optional aflpp_qemu_driver_hook.o not built."
-+ @test -e ../../qemu_mode/qemuafl/qemuafl/api.h && $(CC) $(CPPFLAGS) $(CFLAGS) -funroll-loops -c aflpp_qemu_driver_hook.c || echo "Note: Optional aflpp_qemu_driver_hook.o not built."
-
- test: debug
- #clang -S -emit-llvm -D_DEBUG=\"1\" -I../../include -Wl,--allow-multiple-definition -funroll-loops -o aflpp_driver_test.ll aflpp_driver_test.c
-- afl-clang-fast -D_DEBUG=\"1\" -I../../include -Wl,--allow-multiple-definition -funroll-loops -o aflpp_driver_test aflpp_driver_test.c libAFLDriver.a afl-performance.o
-+ ../../afl-clang-fast -D_DEBUG=\"1\" -I../../include -Wl,--allow-multiple-definition -funroll-loops -o aflpp_driver_test aflpp_driver_test.c libAFLDriver.a afl-performance.o
-
- clean:
- rm -f *.o libAFLDriver*.a libAFLQemuDriver.a aflpp_qemu_driver_hook.so *~ core aflpp_driver_test