Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Mar 2017 08:58:56 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r435215 - in head/security/afl: . files
Message-ID:  <201703020858.v228wuRK093140@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Thu Mar  2 08:58:56 2017
New Revision: 435215
URL: https://svnweb.freebsd.org/changeset/ports/435215

Log:
  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

Deleted:
  head/security/afl/files/
  head/security/afl/pkg-message
Modified:
  head/security/afl/Makefile
  head/security/afl/distinfo
  head/security/afl/pkg-plist

Modified: head/security/afl/Makefile
==============================================================================
--- head/security/afl/Makefile	Thu Mar  2 08:56:14 2017	(r435214)
+++ head/security/afl/Makefile	Thu Mar  2 08:58:56 2017	(r435215)
@@ -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:deve
 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>

Modified: head/security/afl/distinfo
==============================================================================
--- head/security/afl/distinfo	Thu Mar  2 08:56:14 2017	(r435214)
+++ head/security/afl/distinfo	Thu Mar  2 08:58:56 2017	(r435215)
@@ -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

Modified: head/security/afl/pkg-plist
==============================================================================
--- head/security/afl/pkg-plist	Thu Mar  2 08:56:14 2017	(r435214)
+++ head/security/afl/pkg-plist	Thu Mar  2 08:58:56 2017	(r435215)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703020858.v228wuRK093140>