summaryrefslogtreecommitdiff
path: root/pcr/aflplusplus/PKGBUILD
blob: 5ec2988d42064a40477603a014e4298a80f95bdb (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
49
50
51
52
53
54
55
56
57
58
# Maintainer (Aur): GI Jack <GI_Jack@hackermail.com>
# Maintainers: Parabola hackers <dev@lists.parabola.nu>

# parabola changes and rationale:
# - Added armv7h and i686 architectures
# - Added workaround for -fvar-tracking-assignments being in the
#   default /etc/makepkg.conf
# - Added depends=('lldb') to be able to build llvm-lto

pkgname=aflplusplus
pkgver=4.00c
pkgrel=2
pkgdesc="afl++ is afl with community patches, AFLfast power schedules, qemu 3.1 upgrade + laf-intel support, MOpt mutators, InsTrim instrumentation, unicorn_mode and a lot more!"
arch=('armv7h' 'i686' 'x86_64')
url="https://github.com/AFLplusplus/AFLplusplus"
license=('Apache')
provides=('afl')
conflicts=('afl')
makedepends=('lldb')
optdepends=('qemu: use QEMU with afl')
source=("https://github.com/AFLplusplus/AFLplusplus/archive/${pkgver}.tar.gz")
sha256sums=('f427294ed674e37d34a1b756a2190de17937e046ef21abb3ae37bba018a760f1')

# The Arch Linux wiki page on clang[1] has the following:
# "If you are building with debug, also remove
# -fvar-tracking-assignments from DEBUG_CFLAGS and DEBUG_CXXFLAGS as
# Clang does not support it."
# [1]https://wiki.archlinux.org/title/Clang
# And -fvar-tracking-assignments is by default in /etc/makepkg.conf
#
# And without that fix we have the following compilation error:
#     clang-13: error: unknown argument: '-fvar-tracking-assignments'
#     [...]
#     [-] Compiling afl-cc failed. You seem not to have a working compiler.
#     [...]
#     ==> ERROR: A failure occurred in build().
#
DEBUG_CFLAGS="$(echo ${DEBUG_CFLAGS} | sed 's/-fvar-tracking-assignments//')"
DEBUG_CXXFLAGS="$(echo ${DEBUG_CXXFLAGS} | sed 's/-fvar-tracking-assignments//')"

export DEBUG_CFLAGS
export DEBUG_CXXFLAGS

prepare() {
  cd "AFLplusplus-${pkgver}"
  make clean
}

build() {
  cd "AFLplusplus-${pkgver}"
  make PREFIX="/usr"
}

package() {
  cd "AFLplusplus-${pkgver}"
  make install PREFIX="/usr" DESTDIR="${pkgdir}"
}