From fc3148520d0043ee1975680aeb585f42ea0c1a3f Mon Sep 17 00:00:00 2001 From: Jacek Konieczny Date: Fri, 7 Dec 2012 09:30:10 +0100 Subject: [PATCH] Version: 2.2.4 from Debian --- ElectricFence-ac_am.patch | 144 ------------------------------------ ElectricFence-longjmp.patch | 27 ------- ElectricFence-no_bash.patch | 9 --- ElectricFence-pthread.patch | 57 -------------- ElectricFence-va_arg.patch | 11 --- ElectricFence.spec | 48 +++++------- 6 files changed, 18 insertions(+), 278 deletions(-) delete mode 100644 ElectricFence-ac_am.patch delete mode 100644 ElectricFence-longjmp.patch delete mode 100644 ElectricFence-no_bash.patch delete mode 100644 ElectricFence-pthread.patch delete mode 100644 ElectricFence-va_arg.patch diff --git a/ElectricFence-ac_am.patch b/ElectricFence-ac_am.patch deleted file mode 100644 index b4979cd..0000000 --- a/ElectricFence-ac_am.patch +++ /dev/null @@ -1,144 +0,0 @@ -diff -Nru ElectricFence-2.2.2/CHANGES ElectricFence-2.2.2.new/CHANGES ---- ElectricFence-2.2.2/CHANGES Thu Oct 5 18:20:20 2000 -+++ ElectricFence-2.2.2.new/CHANGES Thu Jan 1 01:00:00 1970 -@@ -1,29 +0,0 @@ --2.2.2 Oops. Shared library must be position-independent code. -- --2.2.0 -- Merge in bug-fixes, multi-thread patch, shared library patch, -- debian/ subdirectory used for building the Debian package -- --2.0.1 -- Add work-arounds for kernel and library bugs under HP-UX. -- HP has been notified and will repair these soon. -- --2.0.2 -- Add support for DEC Alpha. Add %a pattern for printing addresses, which -- assumes they are passed in a void *. -- --2.0.3 30-Sep-1993 -- When realloc is passed a zero address, it should work the same -- way as malloc(). Fix forward declaration of mprotect() in page.c to -- use void *, not caddr_t, for addresses. IRIX 5.0.1 complained about that. -- --2.0.4 29-May-1994 -- Don't attempt to allow access to a zero-sized page when -- EF_ALLOW_MALLOC_0 is set. Attempt to un-map memory from -- Page_Delete(). If that doesn't work, fall back by protecting the -- page from all references. Un-mapping small segments of a mapping -- used to crash my SGI IRIX 5.0 system. I assume that nobody is running -- 5.0 any longer. -- --2.0.5 20-January-1995 -- Port to Linux. -diff -Nru ElectricFence-2.2.2/Makefile.am ElectricFence-2.2.2.new/Makefile.am ---- ElectricFence-2.2.2/Makefile.am Thu Jan 1 01:00:00 1970 -+++ ElectricFence-2.2.2.new/Makefile.am Thu Oct 5 18:21:10 2000 -@@ -0,0 +1,27 @@ -+## Process this file with automake to produce Makefile.in -+ -+DEFS = -DUSE_SEMAPHORE -+ -+man_MANS = efence.3 -+ -+lib_LTLIBRARIES = libefence.la -+ -+libefence_la_SOURCES = \ -+ efence.c \ -+ efence.h \ -+ page.c \ -+ print.c -+ -+libefence_la_LDFLAGS = -version-info 0:0:0 -+ -+bin_SCRIPTS = ef -+ -+noinst_PROGRAMS = eftest tstheap -+ -+eftest_SOURCES = eftest.c efence.h -+eftest_LDADD = libefence.la -+ -+tstheap_SOURCES = tstheap.c efence.h -+tstheap_LDADD = libefence.la -+ -+EXTRA_DIST = README -diff -Nru ElectricFence-2.2.2/NEWS ElectricFence-2.2.2.new/NEWS ---- ElectricFence-2.2.2/NEWS Thu Jan 1 01:00:00 1970 -+++ ElectricFence-2.2.2.new/NEWS Tue Apr 13 19:27:29 1999 -@@ -0,0 +1,29 @@ -+2.2.2 Oops. Shared library must be position-independent code. -+ -+2.2.0 -+ Merge in bug-fixes, multi-thread patch, shared library patch, -+ debian/ subdirectory used for building the Debian package -+ -+2.0.1 -+ Add work-arounds for kernel and library bugs under HP-UX. -+ HP has been notified and will repair these soon. -+ -+2.0.2 -+ Add support for DEC Alpha. Add %a pattern for printing addresses, which -+ assumes they are passed in a void *. -+ -+2.0.3 30-Sep-1993 -+ When realloc is passed a zero address, it should work the same -+ way as malloc(). Fix forward declaration of mprotect() in page.c to -+ use void *, not caddr_t, for addresses. IRIX 5.0.1 complained about that. -+ -+2.0.4 29-May-1994 -+ Don't attempt to allow access to a zero-sized page when -+ EF_ALLOW_MALLOC_0 is set. Attempt to un-map memory from -+ Page_Delete(). If that doesn't work, fall back by protecting the -+ page from all references. Un-mapping small segments of a mapping -+ used to crash my SGI IRIX 5.0 system. I assume that nobody is running -+ 5.0 any longer. -+ -+2.0.5 20-January-1995 -+ Port to Linux. -diff -Nru ElectricFence-2.2.2/configure.in ElectricFence-2.2.2.new/configure.in ---- ElectricFence-2.2.2/configure.in Thu Jan 1 01:00:00 1970 -+++ ElectricFence-2.2.2.new/configure.in Thu Oct 5 18:12:38 2000 -@@ -0,0 +1,19 @@ -+dnl Process this file with autoconf to produce a configure script -+ -+AC_INIT(configure.in) -+AM_CONFIG_HEADER(config.h) -+ -+AC_CANONICAL_SYSTEM -+ -+AM_INIT_AUTOMAKE(ElectricFence, 2.2.2) -+ -+AM_MAINTAINER_MODE -+ -+dnl Checks for programs. -+AC_PROG_CC -+AC_PROG_INSTALL -+AC_PROG_LN_S -+AC_PROG_MAKE_SET -+AC_PROG_LIBTOOL -+ -+AC_OUTPUT(Makefile) -diff -Nru ElectricFence-2.2.2/ef ElectricFence-2.2.2.new/ef ---- ElectricFence-2.2.2/ef Thu Jan 1 01:00:00 1970 -+++ ElectricFence-2.2.2.new/ef Thu Oct 5 03:10:38 2000 -@@ -0,0 +1,20 @@ -+#!/bin/sh -+ -+# -+# Simple script to run electric fence on stuff. (needs libefence.so). -+# -+# $Id$ -+# -+ -+# Usage check. -+if [ "$1" = "" ]; then -+ echo "$0: Usage: ef [executable] [arguments]." -+ echo " Runs the executable under the Electric Fence malloc debugger." -+ exit -+fi -+ -+# Set the environment to load eletric fence. -+(\ -+export LD_PRELOAD=libefence.so.0;\ -+exec $*;\ -+) diff --git a/ElectricFence-longjmp.patch b/ElectricFence-longjmp.patch deleted file mode 100644 index 3df3073..0000000 --- a/ElectricFence-longjmp.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- ElectricFence-2.0.5/eftest.c.ewt Tue Jun 2 09:25:10 1998 -+++ ElectricFence-2.0.5/eftest.c Tue Jun 2 09:24:58 1998 -@@ -24,7 +24,7 @@ - extern int EF_PROTECT_BELOW; - extern int EF_ALIGNMENT; - --static jmp_buf env; -+static sigjmp_buf env; - - /* - * There is still too little standardization of the arguments and return -@@ -40,13 +40,13 @@ - ) - { - signal(PAGE_PROTECTION_VIOLATED_SIGNAL, SIG_DFL); -- longjmp(env, 1); -+ siglongjmp(env, 1); - } - - static int - gotSegmentationFault(int (*test)(void)) - { -- if ( setjmp(env) == 0 ) { -+ if ( sigsetjmp(env, 1) == 0 ) { - int status; - - signal(PAGE_PROTECTION_VIOLATED_SIGNAL diff --git a/ElectricFence-no_bash.patch b/ElectricFence-no_bash.patch deleted file mode 100644 index 98c7486..0000000 --- a/ElectricFence-no_bash.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -Nru ElectricFence-2.2.2/ef.sh ElectricFence-2.2.2.new/ef.sh ---- ElectricFence-2.2.2/ef.sh Mon Apr 12 01:59:22 1999 -+++ ElectricFence-2.2.2.new/ef.sh Thu Jun 17 18:04:51 1999 -@@ -1,4 +1,4 @@ --#!/bin/bash -+#!/bin/sh - - # - # Simple script to run electric fence on stuff. (needs libefence.so). diff --git a/ElectricFence-pthread.patch b/ElectricFence-pthread.patch deleted file mode 100644 index 8e6c735..0000000 --- a/ElectricFence-pthread.patch +++ /dev/null @@ -1,57 +0,0 @@ - * Mon Feb 03 2003 Jakub Jelinek - - never call semaphore routines in between - __libc_malloc_pthread_startup(true) and - __libc_malloc_pthread_startup(false) (#83111) - - only use semaphore locking if application or its dependencies - are linked against -lpthread, don't link libefence.so against - -lpthread - ---- ElectricFence-2.2.2/efence.c.jj 1999-04-12 21:00:49.000000000 -0400 -+++ ElectricFence-2.2.2/efence.c 2003-02-03 11:20:18.000000000 -0500 -@@ -174,6 +174,15 @@ static int internalUse = 0; - static int noAllocationListProtection = 0; - - #ifdef USE_SEMAPHORE -+ -+#include -+ -+#pragma weak sem_init -+#pragma weak sem_post -+#pragma weak sem_wait -+ -+static int pthread_initialization = 0; -+ - /* - * EF_sem is a semaphore used to allow one thread at a time into - * these routines. -@@ -274,7 +283,7 @@ initialize(void) - EF_Print(version); - - #ifdef USE_SEMAPHORE -- if (sem_init(&EF_sem, 0, 1) >= 0) { -+ if (sem_init != NULL && !pthread_initialization && sem_init(&EF_sem, 0, 1) >= 0) { - semEnabled = 1; - } - #endif -@@ -397,6 +406,21 @@ initialize(void) - release(); - } - -+#ifdef USE_SEMAPHORE -+void -+__libc_malloc_pthread_startup (bool first_time) -+{ -+ if (first_time) { -+ pthread_initialization = 1; -+ initialize (); -+ } else { -+ pthread_initialization = 0; -+ if (!semEnabled && sem_init != NULL && sem_init(&EF_sem, 0, 1) >= 0) -+ semEnabled = 1; -+ } -+} -+#endif -+ - /* - * allocateMoreSlots is called when there are only enough slot structures - * left to support the allocation of a single malloc buffer. diff --git a/ElectricFence-va_arg.patch b/ElectricFence-va_arg.patch deleted file mode 100644 index 5bfdd71..0000000 --- a/ElectricFence-va_arg.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ElectricFence-2.1/print.c~ Thu Jan 19 22:54:26 1995 -+++ ElectricFence-2.1/print.c Sat Aug 21 13:35:39 1999 -@@ -99,7 +99,7 @@ vprint(const char * pattern, va_list arg - break; - case 'c': - { -- char c = va_arg(args, char); -+ char c = va_arg(args, int); - - (void) write(2, &c, 1); - } diff --git a/ElectricFence.spec b/ElectricFence.spec index 923e38d..9ef89a4 100644 --- a/ElectricFence.spec +++ b/ElectricFence.spec @@ -19,20 +19,13 @@ Summary(sv.UTF-8): Ett avlusningsprogram som upptäcker minnesallokeringsfel Summary(tr.UTF-8): C için bellek hatası ayıklama kitaplığı Summary(zh_CN.UTF-8): 一种调试器用于检测内存分配错误 Name: ElectricFence -Version: 2.2.2 -Release: 16 +Version: 2.2.4 +Release: 1 License: GPL Group: Development/Debuggers -Source0: ftp://ftp.perens.com/pub/ElectricFence/Beta/%{name}-%{version}.tar.gz -# Source0-md5: 56a3cbfdbf65f916988787c789c63e80 -Patch0: %{name}-longjmp.patch -Patch1: %{name}-no_bash.patch -Patch2: %{name}-va_arg.patch -Patch3: %{name}-ac_am.patch -Patch4: %{name}-pthread.patch -BuildRequires: autoconf -BuildRequires: automake -BuildRequires: libtool +Source0: http://ftp.debian.org/debian/pool/main/e/electric-fence/electric-fence_%{version}.tar.gz +# Source0-md5: 78197d625452a9bc2d171e47bce0ddff +Source1: ef.sh Obsoletes: libefence0 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -107,28 +100,22 @@ Static Electric Fence library. Biblioteka statyczna Electric Fence. %prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 +%setup -qn electric-fence-2.2.3 %build -%{__libtoolize} -%{__aclocal} -%{__autoconf} -%{__autoheader} -%{__automake} -CFLAGS="%{rpmcflags} -DUSE_SEMAPHORE" -%configure -%{__make} +%{__make} \ + CFLAGS="%{rpmcflags} -DUSE_SEMAPHORE" %install rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_mandir}/man3} -%{__make} install \ - DESTDIR=$RPM_BUILD_ROOT +install %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/ef +install libefence.a $RPM_BUILD_ROOT%{_libdir} +install libefence.so.0.0 $RPM_BUILD_ROOT%{_libdir} +ln -s libefence.so.0.0 $RPM_BUILD_ROOT%{_libdir}/libefence.so.0 +ln -s libefence.so.0.0 $RPM_BUILD_ROOT%{_libdir}/libefence.so +install libefence.3 $RPM_BUILD_ROOT%{_mandir}/man3 %post -p /sbin/ldconfig %postun -p /sbin/ldconfig @@ -138,9 +125,10 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) -%doc README NEWS +%doc README CHANGES debian/changelog debian/README.debian debian/README.gdb %attr(755,root,root) %{_bindir}/ef -%attr(755,root,root) %{_libdir}/lib*.so.*.* +%attr(755,root,root) %{_libdir}/lib*.so.0.0 +%ghost %attr(755,root,root) %{_libdir}/lib*.so.0 %attr(755,root,root) %{_libdir}/lib*.so %{_mandir}/man3/* -- 2.44.0