aboutsummaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorTobias Kortkamp <tobik@FreeBSD.org>2019-12-01 10:53:40 +0000
committerTobias Kortkamp <tobik@FreeBSD.org>2019-12-01 10:53:40 +0000
commit6a1d6d6c0f2a68b408404089415768ad2639729b (patch)
treeb4c8a347d347dcd8912fd58496d6a091f67b507c /security
parentb3f69fcc76d4d2057b2d541512611fafaf80b978 (diff)
downloadports-6a1d6d6c0f2a68b408404089415768ad2639729b.tar.gz
ports-6a1d6d6c0f2a68b408404089415768ad2639729b.zip
Notes
Diffstat (limited to 'security')
-rw-r--r--security/afl++/Makefile42
-rw-r--r--security/afl++/files/Makefile.extra14
2 files changed, 26 insertions, 30 deletions
diff --git a/security/afl++/Makefile b/security/afl++/Makefile
index 65850aa59f4b..d6ff1f7b39e4 100644
--- a/security/afl++/Makefile
+++ b/security/afl++/Makefile
@@ -22,7 +22,9 @@ USE_GITHUB= yes
GH_ACCOUNT= vanhauser-thc
GH_PROJECT= AFLplusplus
+MAKE_ARGS= STRIP_CMD="${STRIP_CMD}"
ALL_TARGET= all libdislocator
+INSTALL_TARGET= install-strip
TEST_TARGET= test_build
CONFLICTS_INSTALL= afl
@@ -38,6 +40,10 @@ LLVM_DESC= LLVM-based instrumentation
GCC_BUILD_DEPENDS= gcc${GCC_DEFAULT}:lang/gcc${GCC_DEFAULT}
GCC_RUN_DEPENDS= gcc${GCC_DEFAULT}:lang/gcc${GCC_DEFAULT}
+GCC_MAKE_ARGS= GCC=gcc${GCC_DEFAULT} \
+ GXX=g++${GCC_DEFAULT}
+GCC_ALL_TARGET= gcc_plugin
+GCC_TEST_TARGET= test_gcc_plugin
LLVM_BUILD_DEPENDS= clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT}
LLVM_RUN_DEPENDS= clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT}
@@ -68,12 +74,15 @@ post-patch:
# 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
+ ${WRKSRC}/Makefile \
+ ${WRKSRC}/gcc_plugin/Makefile \
+ ${WRKSRC}/llvm_mode/Makefile
.if ${ARCH} == "i386"
@${REINPLACE_CMD} 's@\( as_params\[0\] = afl_as ? afl_as : \)\(.*\)@\1(u8*)"${LOCALBASE}/bin/as";@' \
${WRKSRC}/src/afl-as.c
.endif
- @${CAT} ${FILESDIR}/Makefile.extra >> ${WRKSRC}/Makefile
+ @${REINPLACE_CMD} '/export AFL_CC/d' ${WRKSRC}/test/test.sh
+ @${ECHO_CMD} "include ${FILESDIR}/Makefile.extra" >> ${WRKSRC}/Makefile
post-patch-GCC-on:
@${REINPLACE_CMD} \
@@ -87,47 +96,22 @@ post-patch-LLVM-on:
-e 's|"clang\+\+"|"clang\+\+${LLVM_DEFAULT}"|g' \
${WRKSRC}/llvm_mode/afl-clang-fast.c
-post-build-GCC-on:
- @${DO_MAKE_BUILD} -C ${WRKSRC}/gcc_plugin CC=gcc${GCC_DEFAULT} \
- CXX=g++${GCC_DEFAULT}
-
post-install:
-.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
- @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/afl/*.so
@${MKDIR} ${STAGEDIR}${DOCSDIR}/libdislocator
${INSTALL_MAN} ${WRKSRC}/libdislocator/README.md \
${STAGEDIR}${DOCSDIR}/libdislocator
post-install-GCC-on:
- ${INSTALL_PROGRAM} ${WRKSRC}/afl-g++-fast \
- ${WRKSRC}/afl-gcc-fast \
- ${STAGEDIR}${PREFIX}/bin
- ${INSTALL_MAN} ${WRKSRC}/afl-g++-fast.8 \
- ${WRKSRC}/afl-gcc-fast.8 \
- ${STAGEDIR}${PREFIX}/man/man8
- ${INSTALL_LIB} ${WRKSRC}/afl-gcc-pass.so \
- ${STAGEDIR}${PREFIX}/lib/afl
- ${INSTALL_DATA} ${WRKSRC}/afl-gcc-rt.o \
- ${STAGEDIR}${PREFIX}/lib/afl
@${MKDIR} ${STAGEDIR}${DOCSDIR}/gcc_plugin
${INSTALL_MAN} ${WRKSRC}/gcc_plugin/README.* \
${STAGEDIR}${DOCSDIR}/gcc_plugin
post-install-LLVM-on:
- @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/afl/*.so \
- ${STAGEDIR}${PREFIX}/bin/afl-clang-fast
${MKDIR} ${STAGEDIR}${DOCSDIR}/llvm_mode
${INSTALL_MAN} ${WRKSRC}/llvm_mode/README.* \
${STAGEDIR}${DOCSDIR}/llvm_mode
-post-test-GCC-on:
- @${DO_MAKE_BUILD} -C ${WRKSRC}/gcc_plugin CC=gcc${GCC_DEFAULT} \
- CXX=g++${GCC_DEFAULT} test_build
+post-test:
+ @cd ${WRKSRC}/test && ./test.sh
.include <bsd.port.mk>
diff --git a/security/afl++/files/Makefile.extra b/security/afl++/files/Makefile.extra
index 423e60c53b41..9e0602985d15 100644
--- a/security/afl++/files/Makefile.extra
+++ b/security/afl++/files/Makefile.extra
@@ -1,4 +1,10 @@
-.PHONY: libdislocator llvm_mode test_llvm_mode
+.PHONY: gcc_plugin install-strip libdislocator llvm_mode test_gcc_plugin test_llvm_mode
+
+install-strip: install
+ @cd ${DESTDIR}${BIN_PATH} && ${STRIP_CMD} ${PROGS}
+ @-${STRIP_CMD} ${DESTDIR}${BIN_PATH}/afl-clang-fast
+ @-${STRIP_CMD} ${DESTDIR}${BIN_PATH}/afl-gcc-fast
+ @cd ${DESTDIR}${HELPER_PATH} && ${STRIP_CMD} afl-as *.so
libdislocator:
$(MAKE) -C libdislocator CFLAGS="-I../include ${CFLAGS}"
@@ -8,3 +14,9 @@ llvm_mode:
test_llvm_mode:
$(MAKE) -C llvm_mode test_build
+
+gcc_plugin:
+ $(MAKE) -C gcc_plugin CC="${GCC}" CXX="${GXX}"
+
+test_gcc_plugin:
+ $(MAKE) -C gcc_plugin CC="${GCC}" CXX="${GXX}" test_build