[packages/varnish/VARNISH_2_0] use system libjemalloc

glen glen at pld-linux.org
Fri Dec 13 15:21:37 CET 2013


commit 71a95cfaa0cae16cc9853b8a07c3121e09571465
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Dec 13 13:14:55 2013 +0200

    use system libjemalloc

 system-jemalloc.patch | 41 +++++++++++++++++++++++++++++++++++++++++
 varnish.spec          | 13 ++++++++++---
 2 files changed, 51 insertions(+), 3 deletions(-)
---
diff --git a/varnish.spec b/varnish.spec
index a378d6f..6622bc0 100644
--- a/varnish.spec
+++ b/varnish.spec
@@ -10,7 +10,7 @@ Summary:	Varnish - a high-performance HTTP accelerator
 Summary(pl.UTF-8):	Varnish - wydajny akcelerator HTTP
 Name:		varnish
 Version:	2.0.6
-Release:	7
+Release:	8
 License:	BSD
 Group:		Networking/Daemons/HTTP
 Source0:	http://downloads.sourceforge.net/varnish/%{name}-%{version}.tar.gz
@@ -24,16 +24,18 @@ Source7:	%{name}.conf
 Source8:	%{name}.tmpfiles
 Patch100:	branch.diff
 Patch0:		%{name}-build.patch
-Patch1:		http://users.linpro.no/ingvar/varnish/varnish.fix_CVE-2013-4484.patch.txt
+Patch1:		http://users.linpro.no/ingvar/varnish/%{name}.fix_CVE-2013-4484.patch.txt
+Patch2:		system-jemalloc.patch
 URL:		http://www.varnish-cache.org/
 BuildRequires:	autoconf
 BuildRequires:	automake
 BuildRequires:	groff
+BuildRequires:	jemalloc-devel
 BuildRequires:	libstdc++-devel
-BuildRequires:	sed >= 4.0
 BuildRequires:	libtool >= 2:1.5
 BuildRequires:	ncurses-devel
 BuildRequires:	rpmbuild(macros) >= 1.647
+BuildRequires:	sed >= 4.0
 Requires(postun):	/usr/sbin/groupdel
 Requires(postun):	/usr/sbin/userdel
 Requires(pre):	/bin/id
@@ -51,6 +53,10 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define		skip_post_check_so	libvcl.so.1.0.0
 
+# for -ljemalloc to stay
+# FIXME: how to libjemalloc linked without this hack?
+%define		filterout_ld	-Wl,--as-needed
+
 %description
 The goal of the Varnish project is to develop a state-of-the-art,
 high-performance HTTP accelerator.
@@ -103,6 +109,7 @@ Statyczna biblioteka varnish.
 %patch100 -p0
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %{__sed} -i -e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.ac
 %{__sed} -i -e 's,$(srcdir)/,,' bin/varnishtest/Makefile.am
diff --git a/system-jemalloc.patch b/system-jemalloc.patch
new file mode 100644
index 0000000..7e365ad
--- /dev/null
+++ b/system-jemalloc.patch
@@ -0,0 +1,41 @@
+--- varnish-2.0.6/configure.ac~	2013-12-13 12:30:34.000000000 +0200
++++ varnish-2.0.6/configure.ac	2013-12-13 12:31:38.099161265 +0200
+@@ -375,22 +375,23 @@
+ # Use jemalloc on Linux
+ JEMALLOC_SUBDIR=
+ JEMALLOC_LDADD=
+-AC_ARG_ENABLE(jemalloc,
+-AS_HELP_STRING([--disable-jemalloc],[do not use jemalloc (default is yes on Linux, no everywhere else)]),
+-[if "x$enableval" = "xyes"; then
+-	JEMALLOC_SUBDIR=libjemalloc
+-	JEMALLOC_LDADD='$(top_builddir)/lib/libjemalloc/libjemalloc_mt.la'
+-fi],
+-[case $target in #(
+-*-*-linux*)
+-	JEMALLOC_SUBDIR=libjemalloc
+-	JEMALLOC_LDADD='$(top_builddir)/lib/libjemalloc/libjemalloc_mt.la'
+-	;; #(
+-*)
+-	true
+-	;;
+-esac])
++AC_ARG_WITH([jemalloc],
++            [AS_HELP_STRING([--with-jemalloc],
++              [use jemalloc memory allocator.  Default is yes on Linux,  no elsewhere])],
++            [],
++            [with_jemalloc=check])
+ 
++case $target in
++    *-*-linux*)
++        if test "x$with_jemalloc" != xno; then
++            AC_CHECK_LIB([jemalloc], [malloc],
++                  [JEMALLOC_LDADD="-ljemalloc"],
++                  [AC_MSG_NOTICE([No system jemalloc found, using bundled version])
++                   JEMALLOC_SUBDIR=libjemalloc
++                   JEMALLOC_LDADD='$(top_builddir)/lib/libjemalloc/libjemalloc_mt.la'])
++	fi
++	;;
++esac
+ AC_SUBST(JEMALLOC_SUBDIR)
+ AC_SUBST(JEMALLOC_LDADD)
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/varnish.git/commitdiff/71a95cfaa0cae16cc9853b8a07c3121e09571465



More information about the pld-cvs-commit mailing list