Gentoo Archives: gentoo-commits

From: "Samuli Suominen (ssuominen)" <ssuominen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-util/valgrind/files: valgrind-3.6.0-glibc-2.13.patch valgrind-3.6.0-strcasecmp.patch
Date: Thu, 27 Jan 2011 04:51:43
Message-Id: 20110127045132.D218C20054@flycatcher.gentoo.org
1 ssuominen 11/01/27 04:51:32
2
3 Added: valgrind-3.6.0-glibc-2.13.patch
4 valgrind-3.6.0-strcasecmp.patch
5 Log:
6 Fix compability with recent glibc release.
7
8 (Portage version: 2.2.0_alpha19/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.1 dev-util/valgrind/files/valgrind-3.6.0-glibc-2.13.patch
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/valgrind/files/valgrind-3.6.0-glibc-2.13.patch?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/valgrind/files/valgrind-3.6.0-glibc-2.13.patch?rev=1.1&content-type=text/plain
15
16 Index: valgrind-3.6.0-glibc-2.13.patch
17 ===================================================================
18 http://pkgs.fedoraproject.org/gitweb/?p=valgrind.git;a=summary
19
20 --- valgrind/configure.in
21 +++ valgrind/configure.in
22 @@ -649,6 +649,16 @@ _ACEOF
23 GLIBC_VERSION="`$CPP conftest.$ac_ext | $SED -n 's/^glibc version is: //p' | $SED 's/ /./g'`"
24 fi
25
26 +AC_EGREP_CPP([GLIBC_213], [
27 +#include <features.h>
28 +#ifdef __GNU_LIBRARY__
29 + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 13)
30 + GLIBC_213
31 + #endif
32 +#endif
33 +],
34 +GLIBC_VERSION="2.13")
35 +
36 AC_EGREP_CPP([AIX5_LIBC], [
37 #include <standards.h>
38 #if defined(_AIXVERSION_510) || defined(_AIXVERSION_520) || defined(_AIXVERSION_530)
39 @@ -749,6 +759,13 @@ case "${GLIBC_VERSION}" in
40 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
41 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
42 ;;
43 + 2.13)
44 + AC_MSG_RESULT(2.13 family)
45 + AC_DEFINE([GLIBC_2_13], 1, [Define to 1 if you're using glibc 2.13.x])
46 + DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
47 + DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
48 + DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
49 + ;;
50 aix5)
51 AC_MSG_RESULT(AIX 5.1 or 5.2 or 5.3)
52 AC_DEFINE([AIX5_LIBC], 1, [Define to 1 if you're using AIX 5.1 or 5.2 or 5.3])
53 @@ -762,7 +779,7 @@ case "${GLIBC_VERSION}" in
54
55 *)
56 AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
57 - AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.12])
58 + AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.13])
59 AC_MSG_ERROR([or AIX 5.1 or 5.2 or 5.3 GLIBC_VERSION])
60 AC_MSG_ERROR([or Darwin libc])
61 ;;
62 --- valgrind/config.h.in
63 +++ valgrind/config.h.in
64 @@ -33,6 +33,9 @@
65 /* Define to 1 if you're using glibc 2.12.x */
66 #undef GLIBC_2_12
67
68 +/* Define to 1 if you're using glibc 2.13.x */
69 +#undef GLIBC_2_13
70 +
71 /* Define to 1 if you're using glibc 2.2.x */
72 #undef GLIBC_2_2
73
74
75
76
77 1.1 dev-util/valgrind/files/valgrind-3.6.0-strcasecmp.patch
78
79 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/valgrind/files/valgrind-3.6.0-strcasecmp.patch?rev=1.1&view=markup
80 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/valgrind/files/valgrind-3.6.0-strcasecmp.patch?rev=1.1&content-type=text/plain
81
82 Index: valgrind-3.6.0-strcasecmp.patch
83 ===================================================================
84 http://pkgs.fedoraproject.org/gitweb/?p=valgrind.git;a=summary
85
86 --- valgrind/memcheck/mc_replace_strmem.c
87 +++ valgrind/memcheck/mc_replace_strmem.c
88 @@ -431,6 +430,111 @@ STRCMP(VG_Z_LD64_SO_1, strcmp
89 #endif
90
91
92 +#if defined(VGO_linux)
93 +extern int tolower (int);
94 +
95 +#define STRCASECMP(soname, fnname) \
96 + int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
97 + ( const char* s1, const char* s2 ); \
98 + int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
99 + ( const char* s1, const char* s2 ) \
100 + { \
101 + register unsigned char c1; \
102 + register unsigned char c2; \
103 + while (True) { \
104 + c1 = tolower(*(unsigned char *)s1); \
105 + c2 = tolower(*(unsigned char *)s2); \
106 + if (c1 != c2) break; \
107 + if (c1 == 0) break; \
108 + s1++; s2++; \
109 + } \
110 + if (c1 < c2) return -1; \
111 + if (c1 > c2) return 1; \
112 + return 0; \
113 + }
114 +
115 +STRCASECMP(VG_Z_LIBC_SONAME, strcasecmp)
116 +STRCASECMP(VG_Z_LIBC_SONAME, __GI_strcasecmp)
117 +
118 +
119 +#define STRNCASECMP(soname, fnname) \
120 + int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
121 + ( const char* s1, const char* s2, SizeT nmax ); \
122 + int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
123 + ( const char* s1, const char* s2, SizeT nmax ) \
124 + { \
125 + register unsigned char c1; \
126 + register unsigned char c2; \
127 + SizeT n = 0; \
128 + while (True) { \
129 + if (n >= nmax) return 0; \
130 + if (*s1 == 0 && *s2 == 0) return 0; \
131 + if (*s1 == 0) return -1; \
132 + if (*s2 == 0) return 1; \
133 + c1 = tolower(*(unsigned char*)s1); \
134 + c2 = tolower(*(unsigned char*)s2); \
135 + if (c1 < c2) return -1; \
136 + if (c1 > c2) return 1; \
137 + s1++; s2++; n++; \
138 + } \
139 + }
140 +
141 +STRNCASECMP(VG_Z_LIBC_SONAME, strncasecmp)
142 +STRNCASECMP(VG_Z_LIBC_SONAME, __GI_strncasecmp)
143 +
144 +extern int tolower_l (int, void *) __attribute__((weak));
145 +
146 +#define STRCASECMP_L(soname, fnname) \
147 + int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
148 + ( const char* s1, const char* s2, void* l ); \
149 + int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
150 + ( const char* s1, const char* s2, void* l ) \
151 + { \
152 + register unsigned char c1; \
153 + register unsigned char c2; \
154 + while (True) { \
155 + c1 = tolower_l(*(unsigned char *)s1, l); \
156 + c2 = tolower_l(*(unsigned char *)s2, l); \
157 + if (c1 != c2) break; \
158 + if (c1 == 0) break; \
159 + s1++; s2++; \
160 + } \
161 + if (c1 < c2) return -1; \
162 + if (c1 > c2) return 1; \
163 + return 0; \
164 + }
165 +
166 +STRCASECMP_L(VG_Z_LIBC_SONAME, strcasecmp_l)
167 +STRCASECMP_L(VG_Z_LIBC_SONAME, __GI_strcasecmp_l)
168 +
169 +
170 +#define STRNCASECMP_L(soname, fnname) \
171 + int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
172 + ( const char* s1, const char* s2, SizeT nmax, void* l ); \
173 + int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
174 + ( const char* s1, const char* s2, SizeT nmax, void* l ) \
175 + { \
176 + register unsigned char c1; \
177 + register unsigned char c2; \
178 + SizeT n = 0; \
179 + while (True) { \
180 + if (n >= nmax) return 0; \
181 + if (*s1 == 0 && *s2 == 0) return 0; \
182 + if (*s1 == 0) return -1; \
183 + if (*s2 == 0) return 1; \
184 + c1 = tolower_l(*(unsigned char*)s1, l); \
185 + c2 = tolower_l(*(unsigned char*)s2, l); \
186 + if (c1 < c2) return -1; \
187 + if (c1 > c2) return 1; \
188 + s1++; s2++; n++; \
189 + } \
190 + }
191 +
192 +STRNCASECMP_L(VG_Z_LIBC_SONAME, strncasecmp_l)
193 +STRNCASECMP_L(VG_Z_LIBC_SONAME, __GI_strncasecmp_l)
194 +#endif
195 +
196 +
197 #define MEMCHR(soname, fnname) \
198 void* VG_REPLACE_FUNCTION_ZU(soname,fnname) (const void *s, int c, SizeT n); \
199 void* VG_REPLACE_FUNCTION_ZU(soname,fnname) (const void *s, int c, SizeT n) \