summaryrefslogtreecommitdiff
blob: 95bfacc4b55c39b00b5c72769e073bb5e8ed2adf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit multilib toolchain-funcs flag-o-matic

# See https://github.com/google/AFL/pull/117
PATCHES=( "${FILESDIR}/${P}-install-readmemd.diff" )

DESCRIPTION="american fuzzy lop - compile-time instrumentation fuzzer"
HOMEPAGE="https://lcamtuf.coredump.cx/afl/"
SRC_URI="https://github.com/google/AFL/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"

DEPEND="sys-devel/gcc:*
	!app-forensics/aflplusplus"
RDEPEND="${DEPEND}"
QA_PREBUILT="/usr/share/afl/testcases/others/elf/small_exec.elf"

S="${WORKDIR}/AFL-${PV}"

src_compile() {
	emake CC="$(tc-getCC)" \
		PREFIX="${EPREFIX}/usr" \
		HELPER_PATH="${EPREFIX}/usr/$(get_libdir)/afl" \
		DOC_PATH="${EPREFIX}/usr/share/doc/${PF}"
#	Not compatible with latest clang, see
#	https://github.com/google/AFL/issues/151
#
#	CC="clang" CXX="clang++" strip-unsupported-flags
#	cd llvm_mode || die
#	emake \
#		PREFIX="${EPREFIX}/usr" \
#		HELPER_PATH="${EPREFIX}/usr/$(get_libdir)/afl" \
#		DOC_PATH="${EPREFIX}/usr/share/doc/${PF}"
}

src_install() {
	emake DESTDIR="${D}" \
		PREFIX="${EPREFIX}/usr" \
		HELPER_PATH="${EPREFIX}/usr/$(get_libdir)/afl" \
		DOC_PATH="${EPREFIX}/usr/share/doc/${PF}" \
		install
}