From 7b8cd38af90c005e3c1b3d2f51ffc3d22c38c930 Mon Sep 17 00:00:00 2001 From: Sam James Date: Thu, 22 Jul 2021 05:02:44 +0100 Subject: app-forensics/aflplusplus: allow LLVM 13, Python compat (+3.10, -3.7) Signed-off-by: Sam James --- .../aflplusplus/aflplusplus-3.14c-r1.ebuild | 99 ++++++++++++++++++++++ app-forensics/aflplusplus/aflplusplus-3.14c.ebuild | 98 --------------------- 2 files changed, 99 insertions(+), 98 deletions(-) create mode 100644 app-forensics/aflplusplus/aflplusplus-3.14c-r1.ebuild delete mode 100644 app-forensics/aflplusplus/aflplusplus-3.14c.ebuild diff --git a/app-forensics/aflplusplus/aflplusplus-3.14c-r1.ebuild b/app-forensics/aflplusplus/aflplusplus-3.14c-r1.ebuild new file mode 100644 index 000000000000..066cbd062f6a --- /dev/null +++ b/app-forensics/aflplusplus/aflplusplus-3.14c-r1.ebuild @@ -0,0 +1,99 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{8,9,10} ) +LLVM_MAX_SLOT=13 +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-10:= + || ( + sys-devel/clang:10 + sys-devel/clang:11 + sys-devel/clang:12 + sys-devel/clang:13 + ) + !app-forensics/afl +" +DEPEND=" + ${RDEPEND} + test? ( dev-util/cmocka ) +" + +QA_PREBUILT="/usr/share/afl/testcases/others/elf/small_exec.elf" + +PATCHES=( + "${FILESDIR}/${PN}-3.0c-LDFLAGS.patch" + "${FILESDIR}/${PN}-3.13c-CFLAGS.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_prepare() { + default + + sed -i -e 's/-O3 -fno-unroll-loops//' GNUmakefile || die +} + +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 +} + +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-3.14c.ebuild b/app-forensics/aflplusplus/aflplusplus-3.14c.ebuild deleted file mode 100644 index 9fafa1fa35e0..000000000000 --- a/app-forensics/aflplusplus/aflplusplus-3.14c.ebuild +++ /dev/null @@ -1,98 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{7,8,9} ) -LLVM_MAX_SLOT=12 -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-10:= - || ( - sys-devel/clang:10 - sys-devel/clang:11 - sys-devel/clang:12 - ) - !app-forensics/afl -" -DEPEND=" - ${RDEPEND} - test? ( dev-util/cmocka ) -" - -QA_PREBUILT="/usr/share/afl/testcases/others/elf/small_exec.elf" - -PATCHES=( - "${FILESDIR}/${PN}-3.0c-LDFLAGS.patch" - "${FILESDIR}/${PN}-3.13c-CFLAGS.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_prepare() { - default - - sed -i -e 's/-O3 -fno-unroll-loops//' GNUmakefile || die -} - -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 -} - -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] -} -- cgit v1.2.3