Updates ptmalloc to version 3.

PR:		127012
Submitted by:	Pedro Giffuni
This commit is contained in:
Maho Nakata 2008-09-25 00:45:45 +00:00
parent b1cd19f8eb
commit adc136da65
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=220738
5 changed files with 48 additions and 62 deletions

View file

@ -6,17 +6,18 @@
# $FreeBSD$
PORTNAME= ptmalloc
PORTVERSION= 2.0
PORTREVISION= 1
PORTVERSION= 3.0
CATEGORIES= devel
MASTER_SITES= http://www.malloc.de/malloc/
DISTNAME= ${PORTNAME}2-current
DISTNAME= ${PORTNAME}3-current
MAINTAINER= giffunip@tutopia.com
COMMENT= Alternative threads-aware malloc
USE_LD_CONFIG= yes
WRKSRC= ${WRKDIR}/${PORTNAME}2
WRKSRC= ${WRKDIR}/${PORTNAME}3
USE_GMAKE= yes
ALL_TARGET= posix
INCDIR= include/${PORTNAME}
@ -28,10 +29,10 @@ post-patch:
do-install: all
${MKDIR} ${PREFIX}/${INCDIR}
${INSTALL_DATA} ${WRKSRC}/malloc.h ${PREFIX}/${INCDIR}/
${INSTALL_DATA} ${WRKSRC}/malloc.so ${PREFIX}/lib/libptmalloc.so.2
${LN} -s ${PREFIX}/lib/ptmalloc.so.2 ${PREFIX}/lib/libptmalloc.so
${INSTALL_DATA} ${WRKSRC}/libmalloc.a ${PREFIX}/lib/libptmalloc.a
${INSTALL_DATA} ${WRKSRC}/malloc-2.8.3.h ${PREFIX}/${INCDIR}/malloc.h
${INSTALL_DATA} ${WRKSRC}/libptmalloc3.a ${PREFIX}/lib/libptmalloc.a
${INSTALL_DATA} ${WRKSRC}/ptmalloc3.so ${PREFIX}/lib/libptmalloc.so.3
${LN} -s ${PREFIX}/lib/ptmalloc.so.3 ${PREFIX}/lib/libptmalloc.so
regression-test: build
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} check

View file

@ -1,3 +1,3 @@
MD5 (ptmalloc2-current.tar.gz) = 3db9e72c01ce55da006cdc56b966d7fa
SHA256 (ptmalloc2-current.tar.gz) = 46a5691b19557fde3c3b97c3d86649a40cf5a2a1f4129c37b360907dd1fbdd5a
SIZE (ptmalloc2-current.tar.gz) = 78594
MD5 (ptmalloc3-current.tar.gz) = c0b9dd5f16f8eae979166dc74b60015c
SHA256 (ptmalloc3-current.tar.gz) = f353606f24a579597a1ff5b51009a45d75da047b3975d82c3f613f85bcf312db
SIZE (ptmalloc3-current.tar.gz) = 82712

View file

@ -1,34 +1,32 @@
--- Makefile.orig 2006-06-05 06:13:57.000000000 -0500
+++ Makefile 2008-06-17 20:56:10.000000000 -0500
@@ -15,12 +15,12 @@
--- Makefile.orig 2006-03-31 11:25:23.000000000 -0500
+++ Makefile 2008-08-30 17:37:37.000000000 -0500
@@ -17,12 +17,12 @@
TAR_FLAGS = --numeric-owner --exclude "*~" --exclude "debian/tmp*"
#CC = /pkg/gcc-2.95.2-wg/bin/gcc
-CC = cc
-CC = gcc
+CC ?= cc
SYS_FLAGS =
-OPT_FLAGS = -g -O # -O2
+OPT_FLAGS = -O2 # -O2
WARN_FLAGS = #-Wall -Wstrict-prototypes
-OPT_FLAGS = -g -O2 #-O # -O2
+OPT_FLAGS = -O2 #-O # -O2
WARN_FLAGS = -Wall -Wstrict-prototypes
-SH_FLAGS = -shared -fpic
+SH_FLAGS = -shared -fPIC
INC_FLAGS = -Isysdeps/generic
@@ -35,6 +35,9 @@
THR_FLAGS = -DUSE_TSD_DATA_HACK -D_REENTRANT
THR_LIBS = -lpthread
@@ -44,17 +44,20 @@
MALLOC_OBJ = ptmalloc3.o malloc.o
LIB_MALLOC = libptmalloc3.a
+# Target libraries
+LIBS= libmalloc.a malloc.so
+LIBS = libptmalloc3.a ptmalloc3.so
+
RM = rm -f
AR = ar
RANLIB = ranlib
@@ -46,12 +49,12 @@
T_SUF =
TESTS = t-test1$(T_SUF) t-test2$(T_SUF) \
tst-mallocstate$(T_SUF) tst-mstats$(T_SUF)
tst-independent-alloc$(T_SUF)
#m-test1$(T_SUF) tst-mallocstate$(T_SUF) tst-mstats$(T_SUF)
-CFLAGS = $(SYS_FLAGS) $(OPT_FLAGS) $(WARN_FLAGS) $(THR_FLAGS) $(INC_FLAGS)
+CFLAGS += $(SYS_FLAGS) $(OPT_FLAGS) $(WARN_FLAGS) $(THR_FLAGS) $(INC_FLAGS)
@ -39,14 +37,15 @@
-all: $(LIB_MALLOC) $(TESTS)
+all: $(LIBS) $(TESTS)
malloc.o: malloc.c malloc.h
$(CC) -c $(CFLAGS) $(M_FLAGS) $<
@@ -102,7 +105,7 @@
posix:
$(MAKE) THR_FLAGS='-DUSE_TSD_DATA_HACK -D_REENTRANT' \
OPT_FLAGS='$(OPT_FLAGS)' SYS_FLAGS='$(SYS_FLAGS)' CC='$(CC)' \
- INC_FLAGS='-Isysdeps/pthread -Isysdeps/generic -I.'
+ INC_FLAGS='-Isysdeps/pthread -Isysdeps/generic -I.' \
THR_LIBS=-lpthread
ptmalloc3.o: ptmalloc3.c malloc-2.8.3.h
$(CC) -c $(CFLAGS) $(M_FLAGS) -DMSPACES=1 $<
@@ -72,6 +75,9 @@
libptmalloc3.so: $(MALLOC_OBJ)
$(CC) $(SH_FLAGS) $(CFLAGS) $(M_FLAGS) $(MALLOC_OBJ) -o $@
# posix threads with explicit initialization. Known to be needed on HPUX.
+ptmalloc3.so: ptmalloc3.c malloc-2.8.3.h
+ $(CC) $(SH_FLAGS) $(CFLAGS) $(M_FLAGS) ptmalloc3.c -o $@
+
again:
$(RM) $(TESTS)
$(MAKE) $(TESTS)

View file

@ -1,28 +1,14 @@
ptmalloc is the original version of the malloc that was later included
in GNU libc. This version is also but *not* exclusively LGPL:
This package is a modified version of Doug Lea's malloc-2.8.3
implementation adapted for multiple threads, while trying to
avoid lock contention as much as possible.
Copyright (c) 2001-2006 Wolfram Gloger
As part of the GNU C library, the source files may be available under
the GNU Library General Public License (see the comments in the
files). But as part of this stand-alone package, the code is also
available under the (probably less restrictive) conditions described
in the file 'COPYRIGHT'. In any case, there is no warranty whatsoever
for this package.
Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that (i) the above copyright notices and this permission
notice appear in all copies of the software and related
documentation, and (ii) the name of Wolfram Gloger may not be used
in any advertising or publicity relating to the software.
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL,
INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY
THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
This package comes with no documentation beyond a README, which isn't
worth installing. It appears that the GNU libc man page malloc(3)
applies, but it's not included here for copyright reasons.
This release was partly funded by Pixar Animation Studios.
WWW: http://www.malloc.de/en/

View file

@ -1,5 +1,5 @@
%%INCDIR%%/malloc.h
lib/libptmalloc.a
lib/libptmalloc.so
lib/libptmalloc.so.2
lib/libptmalloc.so.3
@dirrm %%INCDIR%%