[valgrind/f14/master] 3.5.0-19
Jakub Jelinek
jakub at fedoraproject.org
Fri Nov 12 15:03:42 UTC 2010
commit 6ee2345f5d413244ca5026ed12538e5d37d9dde5
Author: Jakub Jelinek <jakub at redhat.com>
Date: Fri Nov 12 16:03:15 2010 +0100
3.5.0-19
valgrind-3.5.0-strcasecmp.patch | 114 +++++++++++++++++++++++++++++++++++++++
valgrind.spec | 7 ++-
2 files changed, 120 insertions(+), 1 deletions(-)
---
diff --git a/valgrind-3.5.0-strcasecmp.patch b/valgrind-3.5.0-strcasecmp.patch
new file mode 100644
index 0000000..8c11d6d
--- /dev/null
+++ b/valgrind-3.5.0-strcasecmp.patch
@@ -0,0 +1,114 @@
+--- valgrind/memcheck/mc_replace_strmem.c.jj 2010-10-20 22:19:25.000000000 +0200
++++ valgrind/memcheck/mc_replace_strmem.c 2010-11-12 10:07:58.559830040 +0100
+@@ -431,6 +430,111 @@ STRCMP(VG_Z_LD64_SO_1, strcmp
+ #endif
+
+
++#if defined(VGO_linux)
++extern int tolower (int);
++
++#define STRCASECMP(soname, fnname) \
++ int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
++ ( const char* s1, const char* s2 ); \
++ int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
++ ( const char* s1, const char* s2 ) \
++ { \
++ register unsigned char c1; \
++ register unsigned char c2; \
++ while (True) { \
++ c1 = tolower(*(unsigned char *)s1); \
++ c2 = tolower(*(unsigned char *)s2); \
++ if (c1 != c2) break; \
++ if (c1 == 0) break; \
++ s1++; s2++; \
++ } \
++ if (c1 < c2) return -1; \
++ if (c1 > c2) return 1; \
++ return 0; \
++ }
++
++STRCASECMP(VG_Z_LIBC_SONAME, strcasecmp)
++STRCASECMP(VG_Z_LIBC_SONAME, __GI_strcasecmp)
++
++
++#define STRNCASECMP(soname, fnname) \
++ int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
++ ( const char* s1, const char* s2, SizeT nmax ); \
++ int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
++ ( const char* s1, const char* s2, SizeT nmax ) \
++ { \
++ register unsigned char c1; \
++ register unsigned char c2; \
++ SizeT n = 0; \
++ while (True) { \
++ if (n >= nmax) return 0; \
++ if (*s1 == 0 && *s2 == 0) return 0; \
++ if (*s1 == 0) return -1; \
++ if (*s2 == 0) return 1; \
++ c1 = tolower(*(unsigned char*)s1); \
++ c2 = tolower(*(unsigned char*)s2); \
++ if (c1 < c2) return -1; \
++ if (c1 > c2) return 1; \
++ s1++; s2++; n++; \
++ } \
++ }
++
++STRNCASECMP(VG_Z_LIBC_SONAME, strncasecmp)
++STRNCASECMP(VG_Z_LIBC_SONAME, __GI_strncasecmp)
++
++extern int tolower_l (int, void *) __attribute__((weak));
++
++#define STRCASECMP_L(soname, fnname) \
++ int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
++ ( const char* s1, const char* s2, void* l ); \
++ int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
++ ( const char* s1, const char* s2, void* l ) \
++ { \
++ register unsigned char c1; \
++ register unsigned char c2; \
++ while (True) { \
++ c1 = tolower_l(*(unsigned char *)s1, l); \
++ c2 = tolower_l(*(unsigned char *)s2, l); \
++ if (c1 != c2) break; \
++ if (c1 == 0) break; \
++ s1++; s2++; \
++ } \
++ if (c1 < c2) return -1; \
++ if (c1 > c2) return 1; \
++ return 0; \
++ }
++
++STRCASECMP_L(VG_Z_LIBC_SONAME, strcasecmp_l)
++STRCASECMP_L(VG_Z_LIBC_SONAME, __GI_strcasecmp_l)
++
++
++#define STRNCASECMP_L(soname, fnname) \
++ int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
++ ( const char* s1, const char* s2, SizeT nmax, void* l ); \
++ int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
++ ( const char* s1, const char* s2, SizeT nmax, void* l ) \
++ { \
++ register unsigned char c1; \
++ register unsigned char c2; \
++ SizeT n = 0; \
++ while (True) { \
++ if (n >= nmax) return 0; \
++ if (*s1 == 0 && *s2 == 0) return 0; \
++ if (*s1 == 0) return -1; \
++ if (*s2 == 0) return 1; \
++ c1 = tolower_l(*(unsigned char*)s1, l); \
++ c2 = tolower_l(*(unsigned char*)s2, l); \
++ if (c1 < c2) return -1; \
++ if (c1 > c2) return 1; \
++ s1++; s2++; n++; \
++ } \
++ }
++
++STRNCASECMP_L(VG_Z_LIBC_SONAME, strncasecmp_l)
++STRNCASECMP_L(VG_Z_LIBC_SONAME, __GI_strncasecmp_l)
++#endif
++
++
+ #define MEMCHR(soname, fnname) \
+ void* VG_REPLACE_FUNCTION_ZU(soname,fnname) (const void *s, int c, SizeT n); \
+ void* VG_REPLACE_FUNCTION_ZU(soname,fnname) (const void *s, int c, SizeT n) \
diff --git a/valgrind.spec b/valgrind.spec
index bcbd5ce..ea3dc6c 100644
--- a/valgrind.spec
+++ b/valgrind.spec
@@ -1,7 +1,7 @@
Summary: Tool for finding memory management bugs in programs
Name: valgrind
Version: 3.5.0
-Release: 18%{?dist}
+Release: 19%{?dist}
Epoch: 1
Source0: http://www.valgrind.org/downloads/valgrind-%{version}.tar.bz2
Patch1: valgrind-3.5.0-cachegrind-improvements.patch
@@ -32,6 +32,7 @@ Patch25: valgrind-3.5.0-syscalls3.patch
Patch26: valgrind-3.5.0-config_h.patch
Patch27: valgrind-3.5.0-capget.patch
Patch28: valgrind-3.5.0-glibc-2.12.patch
+Patch29: valgrind-3.5.0-strcasecmp.patch
License: GPLv2
URL: http://www.valgrind.org/
Group: Development/Debuggers
@@ -127,6 +128,7 @@ for details.
%patch25 -p1
%patch27 -p1
%patch28 -p1
+%patch29 -p1
%build
%ifarch x86_64 ppc64
@@ -222,6 +224,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/valgrind/libmpiwrap*.so
%changelog
+* Fri Nov 12 2010 Jakub Jelinek <jakub at redhat.com> 3.5.0-19
+- provide a replacement for str{,n}casecmp{,_l} (#626470)
+
* Tue May 18 2010 Jakub Jelinek <jakub at redhat.com> 3.5.0-18
- rebuilt against glibc 2.12
More information about the scm-commits
mailing list