summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobik <tobik@FreeBSD.org>2017-03-02 08:58:56 +0000
committertobik <tobik@FreeBSD.org>2017-03-02 08:58:56 +0000
commitbed26b8bb72152dd0d0315c96689f705bcd4a1d8 (patch)
treeda3c1d2e2c98d46d1b5a6113b3f15374d36e6b82
parent59a4402f55f947bb60a65380ac1dc50d85db587d (diff)
downloadFreeBSD-ports-bed26b8bb72152dd0d0315c96689f705bcd4a1d8.zip
FreeBSD-ports-bed26b8bb72152dd0d0315c96689f705bcd4a1d8.tar.gz
Update to 2.39b
- Move to LLVM 3.9 - Remove TEST_INSTRUMENTATION option and move instrumentation tests to the test stage - Remove MINIMIZE_CORPUS option: afl-cmin was always installed anyway - Remove useless pkg-message: afl-cplot prompts you to install gnuplot on its own Changes: http://lcamtuf.coredump.cx/afl/ChangeLog.txt Approved by: mat (mentor) Differential Revision: https://reviews.freebsd.org/D9820
-rw-r--r--security/afl/Makefile71
-rw-r--r--security/afl/distinfo6
-rw-r--r--security/afl/files/patch-Makefile31
-rw-r--r--security/afl/pkg-message1
-rw-r--r--security/afl/pkg-plist3
5 files changed, 38 insertions, 74 deletions
diff --git a/security/afl/Makefile b/security/afl/Makefile
index 3314161..616b63e 100644
--- a/security/afl/Makefile
+++ b/security/afl/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= afl
-PORTVERSION= 2.36
+PORTVERSION= 2.39
DISTVERSIONSUFFIX= b
CATEGORIES= security
MASTER_SITES= http://lcamtuf.coredump.cx/afl/releases/
@@ -13,24 +13,25 @@ COMMENT= Fast instrumented fuzzer
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/docs/COPYING
-USES= compiler gmake tar:tgz
-
-OPTIONS_DEFINE= DEBUG DOCS MINIMIZE_CORPUS LLVM TEST_INSTRUMENTATION
-MINIMIZE_CORPUS_DESC= Install afl-cmin. Adds bash dependency
-TEST_INSTRUMENTATION_DESC= Execute tests (expected to fail in jails)
-LLVM_DESC= LLVM-based instrumentation (broken on 9.x)
-OPTIONS_DEFAULT= LLVM MINIMIZE_CORPUS
-
-OPTIONS_SUB= yes
-
+# In theory afl supports other architectures with the LLVM plugin.
+# It has to be compiled with AFL_NO_X86=1 in that case.
ONLY_FOR_ARCHS= amd64 i386
ONLY_FOR_ARCHS_REASON= Uses binary instrumentation
-LLVM_VERSION= 38
+USES= gmake tar:tgz
+
+TEST_TARGET= test_build
+OPTIONS_DEFINE= DEBUG DOCS LLVM
+OPTIONS_DEFAULT= LLVM
+OPTIONS_SUB= yes
+
+LLVM_DESC= LLVM-based instrumentation
+LLVM_VERSION= 39
LLVM_BUILD_DEPENDS= clang${LLVM_VERSION}:devel/llvm${LLVM_VERSION}
LLVM_RUN_DEPENDS= clang${LLVM_VERSION}:devel/llvm${LLVM_VERSION}
-MINIMIZE_CORPUS_RUN_DEPENDS= ${LOCALBASE}/bin/bash:shells/bash
+LLVM_VARS= CC=clang${LLVM_VERSION} CXX=clang++${LLVM_VERSION} \
+ MAKE_ARGS=LLVM_CONFIG=llvm-config${LLVM_VERSION}
.include <bsd.port.options.mk>
@@ -40,44 +41,40 @@ BUILD_DEPENDS+= ${LOCALBASE}/bin/as:devel/binutils
RUN_DEPENDS+= ${LOCALBASE}/bin/as:devel/binutils
.endif
-MAKE_ARGS= INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
- INSTALL_SCRIPT="${INSTALL_SCRIPT}"
-
-post-patch-TEST_INSTRUMENTATION-off:
-# afl needs shmget() which usually isn't available in jails. Disabling
-# the instrumentation tests makes sure building packages in jails works
-# by default anyway.
- ${REINPLACE_CMD} -e 's@^\(all.*\) test_build@\1@' ${WRKSRC}/Makefile
- ${REINPLACE_CMD} -e 's@^\(all.*\) test_build@\1@' ${WRKSRC}/llvm_mode/Makefile
-
post-patch:
+# Disable the instrumentation tests to make sure building packages in
+# jails works by default. afl needs shmget() which usually isn't
+# available in jails.
+ @${REINPLACE_CMD} 's@^\(all.*\) test_build@\1@' \
+ ${WRKSRC}/Makefile ${WRKSRC}/llvm_mode/Makefile
.if ${ARCH} == "i386"
- ${REINPLACE_CMD} -e 's@\( as_params\[0\] = afl_as ? afl_as : \)\(.*\)@\1(u8*)"${LOCALBASE}/bin/as";@' \
+ @${REINPLACE_CMD} 's@\( as_params\[0\] = afl_as ? afl_as : \)\(.*\)@\1(u8*)"${LOCALBASE}/bin/as";@' \
${WRKSRC}/afl-as.c
.endif
post-patch-LLVM-on:
- ${REINPLACE_CMD} \
+ @${REINPLACE_CMD} \
-e 's|"clang"|"clang${LLVM_VERSION}"|g' \
-e 's|"clang\+\+"|"clang\+\+${LLVM_VERSION}"|g' \
${WRKSRC}/llvm_mode/afl-clang-fast.c
post-build-LLVM-on:
- @(cd ${WRKSRC}/llvm_mode; ${SETENV} \
- CC=clang${LLVM_VERSION} \
- CXX=clang++${LLVM_VERSION} \
- LLVM_CONFIG=llvm-config${LLVM_VERSION} \
- CFLAGS="${CFLAGS}" \
- CXXFLAGS="${CXXFLAGS}" \
- ${GMAKE})
+ @(cd ${WRKSRC}/llvm_mode; ${DO_MAKE_BUILD} ${ALL_TARGET})
+
+post-test-LLVM-on:
+ @(cd ${WRKSRC}/llvm_mode; ${DO_MAKE_BUILD} ${TEST_TARGET})
post-install:
- ${INSTALL_DATA} ${WRKSRC}/docs/COPYING ${STAGEDIR}${DOCSDIR}/
-.for afl_script in afl-cmin afl-plot afl-whatsup
- ${INSTALL_SCRIPT} ${WRKSRC}/${afl_script} ${STAGEDIR}${PREFIX}/bin/
+.for script in afl-cmin afl-plot afl-whatsup
+ ${INSTALL_SCRIPT} ${WRKSRC}/${script} ${STAGEDIR}${PREFIX}/bin
+.endfor
+ @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/afl/afl-as
+.for prog in afl-analyze afl-fuzz afl-gcc afl-gotcpu afl-showmap afl-tmin
+ @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${prog}
.endfor
-post-install-MINIMIZE_CORPUS-on:
- ${INSTALL_SCRIPT} ${WRKSRC}/afl-cmin ${STAGEDIR}${PREFIX}/bin/
+post-install-LLVM-on:
+ @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/afl/afl-llvm-pass.so
+ @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/afl-clang-fast
.include <bsd.port.mk>
diff --git a/security/afl/distinfo b/security/afl/distinfo
index f370c26..d6a51d7 100644
--- a/security/afl/distinfo
+++ b/security/afl/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1484928306
-SHA256 (afl-2.36b.tgz) = d36e2643eaddbd6e79a0dd835fd6e23428198a7a7cd640e96ccbf21d5bd8bcc8
-SIZE (afl-2.36b.tgz) = 830689
+TIMESTAMP = 1487164780
+SHA256 (afl-2.39b.tgz) = 968eceae4d013eee62bc8f2fdddbb7060b92e03a0175153b0285ec7f5c78f141
+SIZE (afl-2.39b.tgz) = 830897
diff --git a/security/afl/files/patch-Makefile b/security/afl/files/patch-Makefile
deleted file mode 100644
index 06cca8f..0000000
--- a/security/afl/files/patch-Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
---- Makefile.orig 2016-08-07 07:03:02 UTC
-+++ Makefile
-@@ -21,6 +21,8 @@ BIN_PATH = $(PREFIX)/bin
- HELPER_PATH = $(PREFIX)/lib/afl
- DOC_PATH = $(PREFIX)/share/doc/afl
- MISC_PATH = $(PREFIX)/share/afl
-+INSTALL_PROGRAM?= install -s -m755
-+INSTALL_SCRIPT?= install -m755
-
- # PROGS intentionally omit afl-as, which gets installed elsewhere.
-
-@@ -120,14 +122,15 @@ clean:
- install: all
- mkdir -p -m 755 $${DESTDIR}$(BIN_PATH) $${DESTDIR}$(HELPER_PATH) $${DESTDIR}$(DOC_PATH) $${DESTDIR}$(MISC_PATH)
- rm -f $${DESTDIR}$(BIN_PATH)/afl-plot.sh
-- install -m 755 $(PROGS) $(SH_PROGS) $${DESTDIR}$(BIN_PATH)
-+ ${INSTALL_PROGRAM} $(PROGS) $${DESTDIR}$(BIN_PATH)
-+ ${INSTALL_SCRIPT} $(SH_PROGS) $${DESTDIR}$(BIN_PATH)
- rm -f $${DESTDIR}$(BIN_PATH)/afl-as
-- if [ -f afl-qemu-trace ]; then install -m 755 afl-qemu-trace $${DESTDIR}$(BIN_PATH); fi
-- if [ -f afl-clang-fast -a -f afl-llvm-pass.so -a -f afl-llvm-rt.o ]; then set -e; install -m 755 afl-clang-fast $${DESTDIR}$(BIN_PATH); ln -sf afl-clang-fast $${DESTDIR}$(BIN_PATH)/afl-clang-fast++; install -m 755 afl-llvm-pass.so afl-llvm-rt.o $${DESTDIR}$(HELPER_PATH); fi
-+ if [ -f afl-qemu-trace ]; then ${INSTALL_PROGRAM} afl-qemu-trace $${DESTDIR}$(BIN_PATH); fi
-+ if [ -f afl-clang-fast -a -f afl-llvm-pass.so -a -f afl-llvm-rt.o ]; then set -e; ${INSTALL_PROGRAM} afl-clang-fast $${DESTDIR}$(BIN_PATH); ln -sf afl-clang-fast $${DESTDIR}$(BIN_PATH)/afl-clang-fast++; ${INSTALL_PROGRAM} afl-llvm-pass.so afl-llvm-rt.o $${DESTDIR}$(HELPER_PATH); fi
- if [ -f afl-llvm-rt-32.o ]; then set -e; install -m 755 afl-llvm-rt-32.o $${DESTDIR}$(HELPER_PATH); fi
- if [ -f afl-llvm-rt-64.o ]; then set -e; install -m 755 afl-llvm-rt-64.o $${DESTDIR}$(HELPER_PATH); fi
- set -e; for i in afl-g++ afl-clang afl-clang++; do ln -sf afl-gcc $${DESTDIR}$(BIN_PATH)/$$i; done
-- install -m 755 afl-as $${DESTDIR}$(HELPER_PATH)
-+ ${INSTALL_PROGRAM} afl-as $${DESTDIR}$(HELPER_PATH)
- ln -sf afl-as $${DESTDIR}$(HELPER_PATH)/as
- install -m 644 docs/README docs/ChangeLog docs/*.txt $${DESTDIR}$(DOC_PATH)
- cp -r testcases/ $${DESTDIR}$(MISC_PATH)
diff --git a/security/afl/pkg-message b/security/afl/pkg-message
deleted file mode 100644
index 6233eb8..0000000
--- a/security/afl/pkg-message
+++ /dev/null
@@ -1 +0,0 @@
-To use afl-plot you also need to install math/gnuplot
diff --git a/security/afl/pkg-plist b/security/afl/pkg-plist
index 50ca255..0350577 100644
--- a/security/afl/pkg-plist
+++ b/security/afl/pkg-plist
@@ -7,7 +7,7 @@ bin/afl-clang++
%%LLVM%%lib/afl/afl-llvm-rt.o
%%LLVM%%lib/afl/afl-llvm-rt-32.o
%%LLVM%%lib/afl/afl-llvm-rt-64.o
-%%MINIMIZE_CORPUS%%bin/afl-cmin
+bin/afl-cmin
bin/afl-fuzz
bin/afl-g++
bin/afl-gcc
@@ -69,7 +69,6 @@ lib/afl/as
%%DATADIR%%/others/sql/simple_queries.sql
%%DATADIR%%/others/text/hello_world.txt
%%DATADIR%%/others/xml/small_document.xml
-%%PORTDOCS%%%%DOCSDIR%%/COPYING
%%PORTDOCS%%%%DOCSDIR%%/ChangeLog
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/env_variables.txt
OpenPOWER on IntegriCloud