[hoard] Initial import
Ryan H. Lewis
rhl at fedoraproject.org
Wed May 2 04:05:56 UTC 2012
commit 963b7566464167e756bb2b8405d2f13f7d97cefd
Author: Ryan H Lewis <me at ryanlewis.net>
Date: Wed May 2 00:04:10 2012 -0400
Initial import
hoard-38-NOBUILD.patch | 115 ++++++++++++++++++++++++++++++++++++++++++++++++
hoard-38-PIC.patch | 38 ++++++++++++++++
hoard.spec | 96 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 249 insertions(+), 0 deletions(-)
---
diff --git a/hoard-38-NOBUILD.patch b/hoard-38-NOBUILD.patch
new file mode 100644
index 0000000..6301a16
--- /dev/null
+++ b/hoard-38-NOBUILD.patch
@@ -0,0 +1,115 @@
+From 22c79c413f40bbe63ef4eab9a458c4a4a17e525e Mon Sep 17 00:00:00 2001
+From: Ralph Bean <rbean at redhat.com>
+Date: Tue, 24 Apr 2012 20:11:35 -0400
+Subject: [PATCH] NOBUILD
+
+---
+ src/gnuwrapper.cpp | 2 +-
+ src/heaplayers/spinlock.h | 4 ++--
+ src/heaplayers/threadheap.h | 4 ++--
+ src/heaplayers/zoneheap.h | 2 +-
+ src/heapmanager.h | 4 ++--
+ src/threadpoolheap.h | 2 +-
+ 6 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/src/gnuwrapper.cpp b/src/gnuwrapper.cpp
+index cc8314f..f2fa398 100644
+--- a/src/gnuwrapper.cpp
++++ b/src/gnuwrapper.cpp
+@@ -39,7 +39,7 @@ extern "C" {
+ static void *(*old_realloc_hook)(void *ptr, size_t size, const void *caller);
+ static void *(*old_memalign_hook)(size_t alignment, size_t size, const void *caller);
+
+- void (*__malloc_initialize_hook) (void) = my_init_hook;
++ void (* volatile __malloc_initialize_hook) (void) = my_init_hook;
+
+ static void my_init_hook (void) {
+ // Store the old hooks.
+diff --git a/src/heaplayers/spinlock.h b/src/heaplayers/spinlock.h
+index 0057c50..ed447ad 100644
+--- a/src/heaplayers/spinlock.h
++++ b/src/heaplayers/spinlock.h
+@@ -130,7 +130,7 @@ public:
+
+
+ #if !defined(__SUNPRO_CC)
+- inline static volatile unsigned long MyInterlockedExchange (unsigned long *,unsigned long);
++ inline static unsigned long MyInterlockedExchange (unsigned long *,unsigned long);
+ #endif
+
+ private:
+@@ -187,7 +187,7 @@ private:
+ // return retval;
+
+ #if !defined(__SUNPRO_CC) // && !defined(__APPLE__)
+-inline volatile unsigned long
++inline unsigned long
+ HL::SpinLockType::MyInterlockedExchange (unsigned long * oldval,
+ unsigned long newval)
+ {
+diff --git a/src/heaplayers/threadheap.h b/src/heaplayers/threadheap.h
+index b51f05b..75caadc 100644
+--- a/src/heaplayers/threadheap.h
++++ b/src/heaplayers/threadheap.h
+@@ -67,7 +67,7 @@ private:
+ }
+
+ // Get a suitable thread id number.
+- inline static volatile int getThreadId (void);
++ inline static int getThreadId (void);
+
+ PerThreadHeap ptHeaps[NumHeaps];
+
+@@ -88,7 +88,7 @@ private:
+ #endif
+
+ template <int NumHeaps, class PerThreadHeap>
+-inline volatile int
++inline int
+ HL::ThreadHeap<NumHeaps, PerThreadHeap>::getThreadId (void) {
+ #if defined(WIN32)
+ // It looks like thread id's are always multiples of 4, so...
+diff --git a/src/heaplayers/zoneheap.h b/src/heaplayers/zoneheap.h
+index 5612ba3..3fb6b4c 100644
+--- a/src/heaplayers/zoneheap.h
++++ b/src/heaplayers/zoneheap.h
+@@ -58,7 +58,7 @@ namespace HL {
+
+ private:
+
+- inline static size_t align (int sz) {
++ inline static size_t align (size_t sz) {
+ return (sz + (sizeof(double) - 1)) & ~(sizeof(double) - 1);
+ }
+
+diff --git a/src/heapmanager.h b/src/heapmanager.h
+index efb8940..a9a9e77 100644
+--- a/src/heapmanager.h
++++ b/src/heapmanager.h
+@@ -39,8 +39,8 @@ namespace Hoard {
+
+ HL::Guard<LockType> g (heapLock);
+
+- unsigned int tid_original = HL::CPUInfo::getThreadId();
+- unsigned int tid = tid_original % HeapType::MaxThreads;
++ unsigned long tid_original = HL::CPUInfo::getThreadId();
++ unsigned int tid = (unsigned int) (tid_original % HeapType::MaxThreads);
+
+ int i = 0;
+ while ((i < HeapType::MaxHeaps) && (HeapType::getInusemap(i)))
+diff --git a/src/threadpoolheap.h b/src/threadpoolheap.h
+index 0cfd7a6..1516ce1 100755
+--- a/src/threadpoolheap.h
++++ b/src/threadpoolheap.h
+@@ -40,7 +40,7 @@ namespace Hoard {
+ }
+
+ inline PerThreadHeap& getHeap (void) {
+- int tid;
++ unsigned long tid;
+ if (anyThreadCreated) {
+ tid = HL::CPUInfo::getThreadId();
+ } else {
+--
+1.7.10
+
diff --git a/hoard-38-PIC.patch b/hoard-38-PIC.patch
new file mode 100644
index 0000000..37c2d7b
--- /dev/null
+++ b/hoard-38-PIC.patch
@@ -0,0 +1,38 @@
+From 3f015b29a5f94792fdcc37ca736af894f1066de2 Mon Sep 17 00:00:00 2001
+From: Ryan H Lewis <me at ryanlewis.net>
+Date: Wed, 2 May 2012 00:02:09 -0400
+Subject: [PATCH] PIC
+
+---
+ Makefile | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 3f588c0..acf10b9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -12,17 +12,17 @@ MACOS_COMPILE_DEBUG := g++ -pipe -g -I. -Iheaplayers -Iheaplayers/util -D_REENTR
+
+ # MACOS_COMPILE_DEBUG := g++ -pipe -g -I. -Iheaplayers -Iheaplayers/util -D_REENTRANT=1 -compatibility_version 1 -current_version 1 -dynamiclib -D'CUSTOM_PREFIX(x)=hoard\#\#x' macwrapper.cpp libhoard.cpp -o libhoard.dylib -ldl -lpthread
+
+-LINUX_GCC_x86_COMPILE := g++ -m32 -I/usr/include/nptl -ffast-math -g -malign-double -pipe -march=pentium4 -O3 -finline-limit=20000 -fomit-frame-pointer -finline-functions -DNDEBUG -I. -Iheaplayers -Iheaplayers/util -D_REENTRANT=1 -shared -D'CUSTOM_PREFIX(x)=hoard\#\#x' gnuwrapper.cpp libhoard.cpp -Bsymbolic -o libhoard.so -ldl -lpthread
++LINUX_GCC_x86_COMPILE := g++ -m32 -fPIC -I/usr/include/nptl -ffast-math -g -malign-double -pipe -march=pentium4 -O3 -finline-limit=20000 -fomit-frame-pointer -finline-functions -DNDEBUG -I. -Iheaplayers -Iheaplayers/util -D_REENTRANT=1 -shared -D'CUSTOM_PREFIX(x)=hoard\#\#x' gnuwrapper.cpp libhoard.cpp -Bsymbolic -o libhoard.so -ldl -lpthread
+
+ # LINUX_GCC_x86_COMPILE := g++ -m32 -I/usr/include/nptl -ffast-math -g -malign-double -pipe -march=pentium4 -O3 -finline-limit=20000 -fomit-frame-pointer -finline-functions -DNDEBUG -I. -Iheaplayers -Iheaplayers/util -D_REENTRANT=1 -shared libhoard.cpp -Bsymbolic -o libhoard.so -ldl -lpthread
+
+-LINUX_GCC_x86_64_COMPILE := g++ -W -Wconversion -Wall -march=nocona -m64 -msse2 -I/usr/include/nptl -pipe -fPIC -O3 -finline-limit=20000 -fomit-frame-pointer -finline-functions -DNDEBUG -I. -Iheaplayers -Iheaplayers/util -D_REENTRANT=1 -shared -D'CUSTOM_PREFIX(x)=hoard\#\#x' gnuwrapper.cpp libhoard.cpp -Bsymbolic -o libhoard.so -ldl -lpthread
++LINUX_GCC_x86_64_COMPILE := g++ -W -fPIC -Wconversion -Wall -march=nocona -m64 -msse2 -I/usr/include/nptl -pipe -fPIC -O3 -finline-limit=20000 -fomit-frame-pointer -finline-functions -DNDEBUG -I. -Iheaplayers -Iheaplayers/util -D_REENTRANT=1 -shared -D'CUSTOM_PREFIX(x)=hoard\#\#x' gnuwrapper.cpp libhoard.cpp -Bsymbolic -o libhoard.so -ldl -lpthread
+
+-LINUX_GCC_x86_64_COMPILE_DEBUG := g++ -W -Wconversion -Wall -march=nocona -m64 -I/usr/include/nptl -pipe -fPIC -O0 -g -I. -Iheaplayers -Iheaplayers/util -D_REENTRANT=1 -shared -D'CUSTOM_PREFIX(x)=hoard\#\#x' gnuwrapper.cpp libhoard.cpp -Bsymbolic -o libhoard.so -ldl -lpthread
++LINUX_GCC_x86_64_COMPILE_DEBUG := g++ -fPIC -W -Wconversion -Wall -march=nocona -m64 -I/usr/include/nptl -pipe -fPIC -O0 -g -I. -Iheaplayers -Iheaplayers/util -D_REENTRANT=1 -shared -D'CUSTOM_PREFIX(x)=hoard\#\#x' gnuwrapper.cpp libhoard.cpp -Bsymbolic -o libhoard.so -ldl -lpthread
+
+ LINUX_GCC_x86_COMPILE_STATIC := g++ -m32 -I/usr/include/nptl -static -malign-double -pipe -march=pentium4 -O3 -finline-limit=20000 -fomit-frame-pointer -finline-functions -DNDEBUG -I. -Iheaplayers -Iheaplayers/util -D_REENTRANT=1 -D'CUSTOM_PREFIX(x)=hoard\#\#x' -c gnuwrapper.cpp libhoard.cpp ; ar cr libhoard.a libhoard.o
+
+-LINUX_GCC_x86_COMPILE_DEBUG := g++ -m32 -O0 -fno-inline -malign-double -I/usr/include/nptl -g -pipe -I. -Iheaplayers -Iheaplayers/util -D_REENTRANT=1 -D'CUSTOM_PREFIX(x)=hoard\#\#x' -shared gnuwrapper.cpp libhoard.cpp -Bsymbolic -o libhoard.so -ldl -lpthread
++LINUX_GCC_x86_COMPILE_DEBUG := g++ -fPIC -m32 -O0 -fno-inline -malign-double -I/usr/include/nptl -g -pipe -I. -Iheaplayers -Iheaplayers/util -D_REENTRANT=1 -D'CUSTOM_PREFIX(x)=hoard\#\#x' -shared gnuwrapper.cpp libhoard.cpp -Bsymbolic -o libhoard.so -ldl -lpthread
+
+ SOLARIS_SUNW_SPARC_COMPILE_32_DEBUG := CC -dalign -mt -g -xildoff -xthreadvar=dynamic -L/usr/lib/lwp -R/usr/lib/lwp -DNDEBUG -I. -Iheaplayers -Iheaplayers/util -D_REENTRANT=1 -G -PIC libhoard.cpp heaplayers/util/sparc-interchange.il -o libhoard_32.so -lthread -ldl -lCrun
+
+--
+1.7.7.6
+
diff --git a/hoard.spec b/hoard.spec
new file mode 100644
index 0000000..da56ca2
--- /dev/null
+++ b/hoard.spec
@@ -0,0 +1,96 @@
+Name: hoard
+Version: 3.8
+%define tar_version 38
+Release: 4%{?dist}
+Summary: A fast, scalable, and memory-efficient allocator
+Group: System Environment/Libraries
+License: GPLv2
+URL: http://www.cs.umass.edu/~emery/hoard
+Source0: http://www.cs.umass.edu/~emery/hoard/hoard-%{version}/source/%{name}-%{tar_version}.tar.gz
+Patch1: hoard-38-NOBUILD.patch
+Patch2: hoard-38-PIC.patch
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{tar_version}-%{release}-XXXXXX)
+BuildRequires: dos2unix
+
+%description
+Hoard is a fast, scalable, and memory-efficient allocator.
+Hoard is a drop-in replacement for malloc that can dramatically improve
+application performance.
+
+
+%package docs
+Summary: Hoard documentation
+Group: System Environment/Libraries
+Requires: %{name}%{?_isa} = %{version}-%{release}
+%description docs
+HTML Documentation for the Hoard Malloc Library
+
+%prep
+%setup -q -n %{name}-%{tar_version}
+find . -exec dos2unix {} \;
+chmod -x src/*.h
+chmod -x src/heaplayers/*.h
+%patch1 -p1
+%patch2 -p1
+
+%build
+rm -fr doc/src/
+dos2unix doc/*
+dos2unix doc/skin/*
+unix2dos doc/skin/{basic,screen,print}.css
+dos2unix doc/skin/{basic,screen,print}.css
+dos2unix doc/skin/images/*
+dos2unix doc/heaplayers-article-cuj_files/*
+find doc -type d -print0 | xargs -0 chmod 755
+find doc -type f -print0 | xargs -0 chmod 644
+cd src
+%ifarch x86_64
+make %{?_smp_mflags} CFLAGS="%{optflags}" BINDIR=%{_bindir} linux-gcc-x86-64-debug
+%else
+make %{?_smp_mflags} CFLAGS="%{optflags}" BINDIR=%{_bindir} linux-gcc-x86-debug
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT%{_libdir}/
+cp -p src/libhoard.so $RPM_BUILD_ROOT/%{_libdir}/
+chmod 0755 $RPM_BUILD_ROOT/%{_libdir}/libhoard.so
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files docs
+%doc doc/* COPYING
+
+%files
+%doc AUTHORS NEWS README THANKS
+%{_libdir}/libhoard.so
+
+%changelog
+* Sat Apr 28 2012 Ryan Lewis <me at ryanlewis.net> - 3.8-4
+- Addresses https://bugzilla.redhat.com/show_bug.cgi?id=753517#c13
+
+* Wed Apr 25 2012 Ryan Lewis <me at ryanlewis.net> - 3.8-3
+- Addresses https://bugzilla.redhat.com/show_bug.cgi?id=753517#c9
+- removed makefile so-name patch.
+
+* Wed Apr 25 2012 Ryan Lewis <me at ryanlewis.net> - 3.8-2
+- Added chmod 0755 libhoard.so
+- Added patch for Makefile so-name.
+ rpmlint is still unhappy. not sure why.
+
+* Tue Apr 24 2012 Ralph Bean <rbean at redhat.com> - 3.8-1
+- Wrapped up new version
+- Fixed the upstream URL
+- Updated the hoard-38-NOBUILD.patch to actually work.
+ Unsure why it didn't already.
+- dos2unix on the whole source before applying our patch.
+
+* Sat Dec 24 2011 Ryan H. Lewis <me at ryanlewis.net> - 371-3
+- added documentation. squashing rpmlint problems.
+
+* Sun Nov 13 2011 Ryan Lewis <me at ryanlewis.net> - 371-2
+- squashed some warnings in rpmlint
+
+* Sat Nov 12 2011 Ryan Lewis <me at ryanlewis.net> - 3.7.1-1
+- Initial spec file
More information about the scm-commits
mailing list