diff --git a/jemalloc/DESCR b/jemalloc/DESCR new file mode 100644 index 0000000000..768ca6e9a9 --- /dev/null +++ b/jemalloc/DESCR @@ -0,0 +1,11 @@ +jemalloc is a general purpose malloc(3) implementation that emphasizes +fragmentation avoidance and scalable concurrency support. + +jemalloc first came into use as the FreeBSD libc allocator in 2005. +In 2010 jemalloc development efforts broadened to include developer support +features such as heap profiling, Valgrind integration, and +extensive monitoring/tuning hooks. +Ongoing development efforts trend toward making jemalloc among the best +allocators for a broad range of demanding applications, and +eliminating/mitigating weaknesses that have practical repercussions +for real world applications. diff --git a/jemalloc/Makefile b/jemalloc/Makefile new file mode 100644 index 0000000000..b7e1f1d9cd --- /dev/null +++ b/jemalloc/Makefile @@ -0,0 +1,32 @@ +# $NetBSD: Makefile,v 1.1 2015/04/30 22:16:52 jonthn Exp $ + +DISTNAME= jemalloc-3.6.0 +CATEGORIES= devel +MASTER_SITES= ${MASTER_SITE_GITHUB:=jemalloc/} +GITHUB_PROJECT= jemalloc + +HOMEPAGE= http://www.canonware.com/jemalloc/ +COMMENT= Library jemalloc is a general purpose malloc(3) implementation +LICENSE= 2-clause-bsd + +BUILD_DEPENDS+= libxslt-[0-9]*:../../textproc/libxslt +BUILD_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl + +USE_TOOLS+= autoconf automake aclocal gmake +USE_LANGUAGES= c +GNU_CONFIGURE= yes +CONFIGURE_ARGS+= --enable-cc-silence +CONFIGURE_ARGS+= --enable-xmalloc +CONFIGURE_ARGS+= --disable-shared +CONFIGURE_ARGS+= --with-xslroot=${LOCALBASE}/share/xsl/docbook/ + +USE_TOOLS+= perl:run +REPLACE_PERL= bin/jepprof + +BUILD_TARGET= all dist + +pre-configure: + cd ${WRKSRC} && ./autogen.sh + cd ${WRKSRC} && mv bin/pprof bin/jepprof + +.include "../../mk/bsd.pkg.mk" diff --git a/jemalloc/PLIST b/jemalloc/PLIST new file mode 100644 index 0000000000..71e9387582 --- /dev/null +++ b/jemalloc/PLIST @@ -0,0 +1,10 @@ +@comment $NetBSD: PLIST,v 1.1 2015/04/30 22:16:52 jonthn Exp $ +bin/jemalloc.sh +bin/jepprof +include/jemalloc/jemalloc.h +lib/libjemalloc.1.dylib +lib/libjemalloc.a +lib/libjemalloc.dylib +lib/libjemalloc_pic.a +man/man3/jemalloc.3 +share/doc/jemalloc/jemalloc.html diff --git a/jemalloc/buildlink3.mk b/jemalloc/buildlink3.mk new file mode 100644 index 0000000000..2f1bf3329e --- /dev/null +++ b/jemalloc/buildlink3.mk @@ -0,0 +1,12 @@ +# $NetBSD: buildlink3.mk,v 1.1 2015/04/30 22:16:52 jonthn Exp $ + +BUILDLINK_TREE+= jemalloc + +.if !defined(JEMALLOC_BUILDLINK3_MK) +JEMALLOC_BUILDLINK3_MK:= + +BUILDLINK_API_DEPENDS.jemalloc+= jemalloc>=3.6.0 +BUILDLINK_PKGSRCDIR.jemalloc?= ../../wip/jemalloc +.endif # JEMALLOC_BUILDLINK3_MK + +BUILDLINK_TREE+= -jemalloc diff --git a/jemalloc/distinfo b/jemalloc/distinfo new file mode 100644 index 0000000000..ee1bafac27 --- /dev/null +++ b/jemalloc/distinfo @@ -0,0 +1,7 @@ +$NetBSD: distinfo,v 1.1 2015/04/30 22:16:52 jonthn Exp $ + +SHA1 (jemalloc-3.6.0.tar.gz) = e05d850acc71987b2334bae0c4d46f8af915d977 +RMD160 (jemalloc-3.6.0.tar.gz) = 816028cbeeda1b4f07e4ee52bc6ea06293f96ae7 +Size (jemalloc-3.6.0.tar.gz) = 335634 bytes +SHA1 (patch-Makefile.in) = 9561c85484fb8412bc770b5cf27b5c130fe37d00 +SHA1 (patch-configure.ac) = 7249bfe0ac333247df874d28ec92346980545375 diff --git a/jemalloc/patches/patch-Makefile.in b/jemalloc/patches/patch-Makefile.in new file mode 100644 index 0000000000..f6d05989b3 --- /dev/null +++ b/jemalloc/patches/patch-Makefile.in @@ -0,0 +1,15 @@ +$NetBSD: patch-Makefile.in,v 1.1 2015/04/30 22:16:52 jonthn Exp $ + +Rename pprof to jepprof to avoid conflict with gperftools + +--- Makefile.in.orig 2015-04-30 21:14:08.000000000 +0000 ++++ Makefile.in +@@ -73,7 +73,7 @@ endif + LIBJEMALLOC := $(LIBPREFIX)jemalloc$(install_suffix) + + # Lists of files. +-BINS := $(srcroot)bin/pprof $(objroot)bin/jemalloc.sh ++BINS := $(srcroot)bin/jepprof $(objroot)bin/jemalloc.sh + C_HDRS := $(objroot)include/jemalloc/jemalloc$(install_suffix).h + C_SRCS := $(srcroot)src/jemalloc.c $(srcroot)src/arena.c \ + $(srcroot)src/atomic.c $(srcroot)src/base.c $(srcroot)src/bitmap.c \ diff --git a/jemalloc/patches/patch-configure.ac b/jemalloc/patches/patch-configure.ac new file mode 100644 index 0000000000..f6bd4a75cb --- /dev/null +++ b/jemalloc/patches/patch-configure.ac @@ -0,0 +1,25 @@ +$NetBSD: patch-configure.ac,v 1.1 2015/04/30 22:16:52 jonthn Exp $ + +- Fix library id for Darwin +- Test should use only one '=' + +--- configure.ac.orig 2014-03-31 16:33:19.000000000 +0000 ++++ configure.ac +@@ -269,7 +269,7 @@ case "${host}" in + so="dylib" + importlib="${so}" + force_tls="0" +- DSO_LDFLAGS='-shared -Wl,-dylib_install_name,$(@F)' ++ DSO_LDFLAGS='-shared -Wl,-install_name,$(LIBDIR)/$(@F)' + SOREV="${rev}.${so}" + sbrk_deprecated="1" + ;; +@@ -869,7 +869,7 @@ fi + dnl Check whether the BSD/SUSv1 sbrk() exists. If not, disable DSS support. + AC_CHECK_FUNC([sbrk], [have_sbrk="1"], [have_sbrk="0"]) + if test "x$have_sbrk" = "x1" ; then +- if test "x$sbrk_deprecated" == "x1" ; then ++ if test "x$sbrk_deprecated" = "x1" ; then + AC_MSG_RESULT([Disabling dss allocation because sbrk is deprecated]) + enable_dss="0" + else