Date: Sun, 1 Dec 2019 08:28:53 +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: r518758 - head/security/afl++ Message-ID: <201912010828.xB18SrhN085932@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tobik Date: Sun Dec 1 08:28:53 2019 New Revision: 518758 URL: https://svnweb.freebsd.org/changeset/ports/518758 Log: security/afl++: Add option to build GCC plugin and afl-gcc-fast Unfortunately not enabled by default since lang/gcc* does not enable plugins support by default yet. Suggested by: David Carlier Modified: head/security/afl++/Makefile head/security/afl++/pkg-plist Modified: head/security/afl++/Makefile ============================================================================== --- head/security/afl++/Makefile Sun Dec 1 08:19:08 2019 (r518757) +++ head/security/afl++/Makefile Sun Dec 1 08:28:53 2019 (r518758) @@ -27,14 +27,18 @@ TEST_TARGET= test_build CONFLICTS_INSTALL= afl -OPTIONS_DEFINE= DEBUG DOCS LLVM +OPTIONS_DEFINE= DEBUG DOCS GCC LLVM OPTIONS_DEFAULT= LLVM # On non-x86 architectures LLVM is mandatory OPTIONS_SLAVE= ${ARCH:Namd64:Ni386:S/${ARCH}/LLVM/} OPTIONS_SUB= yes +GCC_DESC= Build GCC plugin and afl-gcc-fast 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} + LLVM_BUILD_DEPENDS= clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT} LLVM_RUN_DEPENDS= clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT} LLVM_MAKE_ARGS= LLVM_CONFIG=llvm-config${LLVM_DEFAULT} @@ -71,12 +75,22 @@ post-patch: .endif @${CAT} ${FILESDIR}/Makefile.extra >> ${WRKSRC}/Makefile +post-patch-GCC-on: + @${REINPLACE_CMD} \ + -e 's|"gcc"|"gcc${GCC_DEFAULT}"|g' \ + -e 's|"g\+\+"|"g\+\+${GCC_DEFAULT}"|g' \ + ${WRKSRC}/gcc_plugin/afl-gcc-fast.c + post-patch-LLVM-on: @${REINPLACE_CMD} \ -e 's|"clang"|"clang${LLVM_DEFAULT}"|g' \ -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 @@ -85,17 +99,35 @@ post-install: .for prog in afl-analyze afl-fuzz afl-gcc afl-gotcpu afl-showmap afl-tmin @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${prog} .endfor - ${INSTALL_LIB} ${WRKSRC}/libdislocator.so \ - ${STAGEDIR}${PREFIX}/lib/afl - ${MKDIR} ${STAGEDIR}${DOCSDIR}/libdislocator + @${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 .include <bsd.port.mk> Modified: head/security/afl++/pkg-plist ============================================================================== --- head/security/afl++/pkg-plist Sun Dec 1 08:19:08 2019 (r518757) +++ head/security/afl++/pkg-plist Sun Dec 1 08:28:53 2019 (r518758) @@ -3,6 +3,8 @@ bin/afl-analyze %%X86%%bin/afl-clang++ %%LLVM%%bin/afl-clang-fast %%LLVM%%bin/afl-clang-fast++ +%%GCC%%bin/afl-g++-fast +%%GCC%%bin/afl-gcc-fast bin/afl-cmin bin/afl-fuzz %%X86%%bin/afl-g++ @@ -14,6 +16,8 @@ bin/afl-system-config bin/afl-tmin bin/afl-whatsup %%X86%%lib/afl/afl-as +%%GCC%%lib/afl/afl-gcc-pass.so +%%GCC%%lib/afl/afl-gcc-rt.o %%LLVM%%lib/afl/afl-llvm-pass.so %%X86%%%%LLVM%%lib/afl/afl-llvm-rt-32.o %%LLVM%%lib/afl/afl-llvm-rt-64.o @@ -28,6 +32,8 @@ lib/afl/libdislocator.so %%LLVM%%man/man8/afl-clang-fast++.8.gz man/man8/afl-cmin.8.gz man/man8/afl-fuzz.8.gz +%%GCC%%man/man8/afl-g++-fast.8.gz +%%GCC%%man/man8/afl-gcc-fast.8.gz man/man8/afl-gcc.8.gz man/man8/afl-gotcpu.8.gz man/man8/afl-plot.8.gz @@ -93,6 +99,8 @@ man/man8/afl-whatsup.8.gz %%PORTDOCS%%%%DOCSDIR%%/binaryonly_fuzzing.txt %%PORTDOCS%%%%DOCSDIR%%/custom_mutator.txt %%PORTDOCS%%%%DOCSDIR%%/env_variables.txt +%%GCC%%%%PORTDOCS%%%%DOCSDIR%%/gcc_plugin/README.gcc.md +%%GCC%%%%PORTDOCS%%%%DOCSDIR%%/gcc_plugin/README.whitelist.md %%PORTDOCS%%%%DOCSDIR%%/historical_notes.txt %%PORTDOCS%%%%DOCSDIR%%/libdislocator/README.md %%PORTDOCS%%%%DOCSDIR%%/life_pro_tips.txt
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912010828.xB18SrhN085932>