pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

deepstate: add support for libfuzzer



Module Name:	pkgsrc-wip
Committed By:	Pierre Pronchery <khorben%defora.org@localhost>
Pushed By:	khorben
Date:		Sat Sep 26 05:18:32 2020 +0200
Changeset:	3e9a9991e56a21ebb9f0c231b3dad8b362e3bdbc

Modified Files:
	Makefile
	deepstate-afl/Makefile
	deepstate-honggfuzz/Makefile
	py-deepstate/Makefile
Added Files:
	deepstate-libfuzzer/DESCR
	deepstate-libfuzzer/Makefile
	deepstate-libfuzzer/PLIST

Log Message:
deepstate: add support for libfuzzer

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=3e9a9991e56a21ebb9f0c231b3dad8b362e3bdbc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                     |  1 +
 deepstate-afl/Makefile       |  8 ++++----
 deepstate-honggfuzz/Makefile |  8 ++++----
 deepstate-libfuzzer/DESCR    |  8 ++++++++
 deepstate-libfuzzer/Makefile | 29 +++++++++++++++++++++++++++++
 deepstate-libfuzzer/PLIST    |  2 ++
 py-deepstate/Makefile        |  1 +
 7 files changed, 49 insertions(+), 8 deletions(-)

diffs:
diff --git a/Makefile b/Makefile
index a479db243d..0c16ccc3f3 100644
--- a/Makefile
+++ b/Makefile
@@ -613,6 +613,7 @@ SUBDIR+=	dee
 SUBDIR+=	deepstate
 SUBDIR+=	deepstate-afl
 SUBDIR+=	deepstate-honggfuzz
+SUBDIR+=	deepstate-libfuzzer
 SUBDIR+=	deforaos-accessories
 SUBDIR+=	deforaos-desktop
 SUBDIR+=	deforaos-framer
diff --git a/deepstate-afl/Makefile b/deepstate-afl/Makefile
index d391b2e7bd..fe7509684b 100644
--- a/deepstate-afl/Makefile
+++ b/deepstate-afl/Makefile
@@ -9,13 +9,13 @@ AUTO_MKDIRS=	yes
 DEPENDS+=	afl-[0-9]*:../../devel/afl
 DEPENDS+=	deepstate>=${VERSION}:../../wip/deepstate
 
+CONFIGURE_DIRS=	${WRKSRC}/build
 CMAKE_ARG_PATH=	${WRKSRC}
+
 CMAKE_ARGS+=	-DPYTHON=${PREFIX}/bin/python${PYVERSSUFFIX}
 CMAKE_ARGS+=	-DDEEPSTATE_AFL=ON
-CONFIGURE_DIRS=	${WRKSRC}/build
-#XXX should work with CONFIGURE_ENV instead
-PKGSRC_MAKE_ENV+=	CC=${LOCALBASE}/bin/afl-gcc
-PKGSRC_MAKE_ENV+=	CXX=${LOCALBASE}/bin/afl-g++
+CMAKE_ARGS+=	-DCMAKE_C_COMPILER=${LOCALBASE:Q}/bin/afl-gcc
+CMAKE_ARGS+=	-DCMAKE_CXX_COMPILER=${LOCALBASE:Q}/bin/afl-g++
 
 pre-configure:
 	${MKDIR} ${CONFIGURE_DIRS}
diff --git a/deepstate-honggfuzz/Makefile b/deepstate-honggfuzz/Makefile
index 9c72ec7ab2..df374bf5cf 100644
--- a/deepstate-honggfuzz/Makefile
+++ b/deepstate-honggfuzz/Makefile
@@ -9,13 +9,13 @@ AUTO_MKDIRS=	yes
 DEPENDS+=	honggfuzz-[0-9]*:../../devel/honggfuzz
 DEPENDS+=	deepstate>=${VERSION}:../../wip/deepstate
 
+CONFIGURE_DIRS=	${WRKSRC}/build
 CMAKE_ARG_PATH=	${WRKSRC}
+
 CMAKE_ARGS+=	-DPYTHON=${PREFIX}/bin/python${PYVERSSUFFIX}
 CMAKE_ARGS+=	-DDEEPSTATE_HONGGFUZZ=ON
-CONFIGURE_DIRS=	${WRKSRC}/build
-#XXX should work with CONFIGURE_ENV instead
-PKGSRC_MAKE_ENV+=	CC=${LOCALBASE}/bin/hfuzz-gcc
-PKGSRC_MAKE_ENV+=	CXX=${LOCALBASE}/bin/hfuzz-g++
+CMAKE_ARGS+=	-DCMAKE_C_COMPILER=${LOCALBASE:Q}/bin/hfuzz-gcc
+CMAKE_ARGS+=	-DCMAKE_CXX_COMPILER=${LOCALBASE:Q}/bin/hfuzz-g++
 
 pre-configure:
 	${MKDIR} ${CONFIGURE_DIRS}
diff --git a/deepstate-libfuzzer/DESCR b/deepstate-libfuzzer/DESCR
new file mode 100644
index 0000000000..95bb6b0d6a
--- /dev/null
+++ b/deepstate-libfuzzer/DESCR
@@ -0,0 +1,8 @@
+DeepState is a framework that provides C and C++ developers with a common
+interface to various symbolic execution and fuzzing engines. Users can write
+one test harness using a Google Test-like API, then execute it using multiple
+backends without having to learn the complexities of the underlying engines. It
+supports writing unit tests and API sequence tests, as well as automatic test
+generation.
+
+This package adds support for libfuzzer to DeepState.
diff --git a/deepstate-libfuzzer/Makefile b/deepstate-libfuzzer/Makefile
new file mode 100644
index 0000000000..dc345a4de4
--- /dev/null
+++ b/deepstate-libfuzzer/Makefile
@@ -0,0 +1,29 @@
+# $NetBSD$
+
+PKGNAME=	deepstate-libfuzzer-${VERSION}
+
+USE_LANGUAGES=	c99 c++
+USE_CMAKE=	yes
+AUTO_MKDIRS=	yes
+
+DEPENDS+=	deepstate>=${VERSION}:../../wip/deepstate
+
+CONFIGURE_DIRS=	${WRKSRC}/build
+CMAKE_ARG_PATH=	${WRKSRC}
+
+CMAKE_ARGS+=	-DPYTHON=${PREFIX}/bin/python${PYVERSSUFFIX}
+CMAKE_ARGS+=	-DDEEPSTATE_LIBFUZZER=ON
+CMAKE_ARGS+=	-DCMAKE_C_COMPILER=${CLANGBASE:Q}/bin/clang
+CMAKE_ARGS+=	-DCMAKE_CXX_COMPILER=${CLANGBASE:Q}/bin/clang++
+
+pre-configure:
+	${MKDIR} ${CONFIGURE_DIRS}
+
+do-install:
+	${INSTALL_LIB} ${WRKSRC}/build/libdeepstate_LF.a ${DESTDIR}${PREFIX}/lib
+
+.include "../../mk/compiler/clang.mk"
+.include "../../lang/compiler-rt/buildlink3.mk"
+.include "../../wip/deepstate/Makefile.common"
+.include "../../lang/python/pyversion.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/deepstate-libfuzzer/PLIST b/deepstate-libfuzzer/PLIST
new file mode 100644
index 0000000000..f845747f36
--- /dev/null
+++ b/deepstate-libfuzzer/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD$
+lib/libdeepstate_LF.a
diff --git a/py-deepstate/Makefile b/py-deepstate/Makefile
index fafc07500e..57b1d739ec 100644
--- a/py-deepstate/Makefile
+++ b/py-deepstate/Makefile
@@ -10,6 +10,7 @@ DEPENDS+=	deepstate>=${VERSION}:../../wip/deepstate
 DEPENDS+=	deepstate-afl>=${VERSION}:../../wip/deepstate-afl
 #XXX seems to not build on NetBSD
 #DEPENDS+=	deepstate-honggfuzz>=${VERSION}:../../wip/deepstate-honggfuzz
+DEPENDS+=	deepstate-libfuzzer>=${VERSION}:../../wip/deepstate-libfuzzer
 
 PYTHON_VERSIONS_ACCEPTED=	37 36
 


Home | Main Index | Thread Index | Old Index