Gentoo Archives: gentoo-commits

From: "Marien Zwart (marienz)" <marienz@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-python/pypy/files: 1.9-get_python_lib_standard_lib-04ea518e5b71.patch 1.9-more-ignored-ops-a9a8faa76bca.patch 1.9-no-static-hack.patch 1.9-pybuffer-release-double-decref-4ec2a5b49386.patch 1.9-ssl-errors-25d3418150d2.patch 1.9-ssl-threads-2-25cd11066d95.patch 1.9-getargs-freelist-c26dc70ee340.patch 1.9-more-ignored-ops-146ddf82a279.patch 1.9-ssl-threads-1-34b3b5aac082.patch 1.9-signal-a33052b17f4e.patch
Date: Sun, 17 Jun 2012 15:29:26
Message-Id: 20120617152917.1BBD62004B@flycatcher.gentoo.org
1 marienz 12/06/17 15:29:17
2
3 Added: 1.9-get_python_lib_standard_lib-04ea518e5b71.patch
4 1.9-more-ignored-ops-a9a8faa76bca.patch
5 1.9-no-static-hack.patch
6 1.9-pybuffer-release-double-decref-4ec2a5b49386.patch
7 1.9-ssl-errors-25d3418150d2.patch
8 1.9-ssl-threads-2-25cd11066d95.patch
9 1.9-getargs-freelist-c26dc70ee340.patch
10 1.9-more-ignored-ops-146ddf82a279.patch
11 1.9-ssl-threads-1-34b3b5aac082.patch
12 1.9-signal-a33052b17f4e.patch
13 Log:
14 Revision bump including several patches from upstream (including a fix for bug #421361), a fix needed for prefix (bug #420621, thanks to XU Benda) and support for picking up -j from MAKEOPTS (bug #403991).
15
16 (Portage version: 2.2.0_alpha110/cvs/Linux x86_64)
17
18 Revision Changes Path
19 1.1 dev-python/pypy/files/1.9-get_python_lib_standard_lib-04ea518e5b71.patch
20
21 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-get_python_lib_standard_lib-04ea518e5b71.patch?rev=1.1&view=markup
22 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-get_python_lib_standard_lib-04ea518e5b71.patch?rev=1.1&content-type=text/plain
23
24 Index: 1.9-get_python_lib_standard_lib-04ea518e5b71.patch
25 ===================================================================
26 changeset: 55566:04ea518e5b71
27 parent: 55554:fa1ecb3a52df
28 user: Armin Rigo <arigo@×××××.org>
29 date: Mon Jun 11 10:28:26 2012 +0200
30 summary: issue1164: get_python_lib(standard_lib=1) should probably just
31
32 diff -r fa1ecb3a52df -r 04ea518e5b71 lib-python/2.7/distutils/sysconfig_pypy.py
33 --- a/lib-python/2.7/distutils/sysconfig_pypy.py Sun Jun 10 23:49:16 2012 +0300
34 +++ b/lib-python/2.7/distutils/sysconfig_pypy.py Mon Jun 11 10:28:26 2012 +0200
35 @@ -39,11 +39,10 @@
36 If 'prefix' is supplied, use it instead of sys.prefix or
37 sys.exec_prefix -- i.e., ignore 'plat_specific'.
38 """
39 - if standard_lib:
40 - raise DistutilsPlatformError(
41 - "calls to get_python_lib(standard_lib=1) cannot succeed")
42 if prefix is None:
43 prefix = PREFIX
44 + if standard_lib:
45 + return os.path.join(prefix, "lib-python", get_python_version())
46 return os.path.join(prefix, 'site-packages')
47
48
49
50
51
52
53 1.1 dev-python/pypy/files/1.9-more-ignored-ops-a9a8faa76bca.patch
54
55 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-more-ignored-ops-a9a8faa76bca.patch?rev=1.1&view=markup
56 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-more-ignored-ops-a9a8faa76bca.patch?rev=1.1&content-type=text/plain
57
58 Index: 1.9-more-ignored-ops-a9a8faa76bca.patch
59 ===================================================================
60 changeset: 55523:a9a8faa76bca
61 parent: 55518:f0daafccddc5
62 user: Armin Rigo <arigo@×××××.org>
63 date: Fri Jun 08 19:55:01 2012 +0200
64 summary: Add more instructions to ignore by copying from Intel docs.
65
66 diff -r f0daafccddc5 -r a9a8faa76bca pypy/translator/c/gcc/trackgcroot.py
67 --- a/pypy/translator/c/gcc/trackgcroot.py Fri Jun 08 18:30:54 2012 +0200
68 +++ b/pypy/translator/c/gcc/trackgcroot.py Fri Jun 08 19:55:01 2012 +0200
69 @@ -483,8 +483,10 @@
70 'inc', 'dec', 'not', 'neg', 'or', 'and', 'sbb', 'adc',
71 'shl', 'shr', 'sal', 'sar', 'rol', 'ror', 'mul', 'imul', 'div', 'idiv',
72 'bswap', 'bt', 'rdtsc',
73 - 'punpck', 'pshufd', 'pcmp', 'pand', 'psllw', 'pslld', 'psllq',
74 - 'paddq', 'pinsr', 'pmul', 'psrl',
75 + 'pabs', 'pack', 'padd', 'palign', 'pand', 'pavg', 'pcmp', 'pextr',
76 + 'phadd', 'phsub', 'pinsr', 'pmadd', 'pmax', 'pmin', 'pmovmsk',
77 + 'pmul', 'por', 'psadb', 'pshuf', 'psign', 'psll', 'psra', 'psrl',
78 + 'psub', 'punpck', 'pxor',
79 # all vectors don't produce pointers
80 'v',
81 # sign-extending moves should not produce GC pointers
82 @@ -492,7 +494,7 @@
83 # zero-extending moves should not produce GC pointers
84 'movz',
85 # locked operations should not move GC pointers, at least so far
86 - 'lock',
87 + 'lock', 'pause',
88 ])
89
90 # a partial list is hopefully good enough for now; it's all to support
91
92
93
94
95 1.1 dev-python/pypy/files/1.9-no-static-hack.patch
96
97 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-no-static-hack.patch?rev=1.1&view=markup
98 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-no-static-hack.patch?rev=1.1&content-type=text/plain
99
100 Index: 1.9-no-static-hack.patch
101 ===================================================================
102 Remove logic that links to libssl and libcrypto statically if
103 possible. Just always link dynamically: Gentoo is expected to have
104 sane dynamic libraries for us to use, and our users are not expected
105 to copy their pypy binary to a system with an incompatible
106 libssl/libcrypto and expect it to work.
107
108 Patch contributed by XU Benda <heroxbd@g.o>.
109
110 --- pypy/rlib/ropenssl.py 2012-06-07 21:24:48.000000000 +0900
111 +++ pypy/rlib/ropenssl.py.new 2012-06-10 17:28:29.000000000 +0900
112 @@ -19,18 +19,8 @@ if sys.platform == 'win32' and platform.
113 # so that openssl/ssl.h can repair this nonsense.
114 'wincrypt.h']
115 else:
116 - libraries = ['z']
117 + libraries = ['z', 'ssl', 'crypto']
118 includes = []
119 - if (sys.platform.startswith('linux') and
120 - os.path.exists('/usr/lib/libssl.a') and
121 - os.path.exists('/usr/lib/libcrypto.a')):
122 - # use static linking to avoid the infinite
123 - # amount of troubles due to symbol versions
124 - # and 0.9.8/1.0.0
125 - link_files += ['/usr/lib/libssl.a', '/usr/lib/libcrypto.a']
126 - testonly_libraries += ['ssl', 'crypto']
127 - else:
128 - libraries += ['ssl', 'crypto']
129
130 includes += [
131 'openssl/ssl.h',
132
133
134
135 1.1 dev-python/pypy/files/1.9-pybuffer-release-double-decref-4ec2a5b49386.patch
136
137 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-pybuffer-release-double-decref-4ec2a5b49386.patch?rev=1.1&view=markup
138 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-pybuffer-release-double-decref-4ec2a5b49386.patch?rev=1.1&content-type=text/plain
139
140 Index: 1.9-pybuffer-release-double-decref-4ec2a5b49386.patch
141 ===================================================================
142 changeset: 55598:4ec2a5b49386
143 tag: tip
144 user: Armin Rigo <arigo@×××××.org>
145 date: Mon Jun 11 19:54:04 2012 +0200
146 summary: Test and fix (thanks marienz)
147
148 diff -r cdb2d1b3d0da -r 4ec2a5b49386 pypy/module/cpyext/object.py
149 --- a/pypy/module/cpyext/object.py Mon Jun 11 19:41:35 2012 +0200
150 +++ b/pypy/module/cpyext/object.py Mon Jun 11 19:54:04 2012 +0200
151 @@ -489,3 +489,4 @@
152 provides a subset of CPython's behavior.
153 """
154 Py_DecRef(space, view.c_obj)
155 + view.c_obj = lltype.nullptr(PyObject.TO)
156 diff -r cdb2d1b3d0da -r 4ec2a5b49386 pypy/module/cpyext/test/test_object.py
157 --- a/pypy/module/cpyext/test/test_object.py Mon Jun 11 19:41:35 2012 +0200
158 +++ b/pypy/module/cpyext/test/test_object.py Mon Jun 11 19:54:04 2012 +0200
159 @@ -363,6 +363,10 @@
160 * Py_buffer and the string should be released as well.
161 */
162 PyBuffer_Release(&buf);
163 + assert(!buf.obj);
164 + PyBuffer_Release(&buf); /* call again, should not have any more effect */
165 + PyBuffer_Release(&buf);
166 + PyBuffer_Release(&buf);
167
168 Py_RETURN_NONE;
169 """)])
170
171
172
173
174 1.1 dev-python/pypy/files/1.9-ssl-errors-25d3418150d2.patch
175
176 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-ssl-errors-25d3418150d2.patch?rev=1.1&view=markup
177 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-ssl-errors-25d3418150d2.patch?rev=1.1&content-type=text/plain
178
179 Index: 1.9-ssl-errors-25d3418150d2.patch
180 ===================================================================
181 # HG changeset patch
182 # User Amaury Forgeot d'Arc <amauryfa@×××××.com>
183 # Date 1339449304 -7200
184 # Node ID 25d3418150d2e2820913043432f568e31bf3a19a
185 # Parent 33c305197a3d05217be023fa39a692ad89802317
186 issue1169: _ssl errors outside any SSL context should use ERR_peek_last_error()
187
188 diff -r 33c305197a3d05217be023fa39a692ad89802317 -r 25d3418150d2e2820913043432f568e31bf3a19a pypy/module/_ssl/interp_ssl.py
189 --- a/pypy/module/_ssl/interp_ssl.py Mon Jun 11 23:01:31 2012 +0200
190 +++ b/pypy/module/_ssl/interp_ssl.py Mon Jun 11 23:15:04 2012 +0200
191 @@ -789,7 +789,11 @@
192 def _ssl_seterror(space, ss, ret):
193 assert ret <= 0
194
195 - if ss and ss.ssl:
196 + if ss is None:
197 + errval = libssl_ERR_peek_last_error()
198 + errstr = rffi.charp2str(libssl_ERR_error_string(errval, None))
199 + return ssl_error(space, errstr, errval)
200 + elif ss.ssl:
201 err = libssl_SSL_get_error(ss.ssl, ret)
202 else:
203 err = SSL_ERROR_SSL
204 diff -r 33c305197a3d05217be023fa39a692ad89802317 -r 25d3418150d2e2820913043432f568e31bf3a19a pypy/rlib/ropenssl.py
205 --- a/pypy/rlib/ropenssl.py Mon Jun 11 23:01:31 2012 +0200
206 +++ b/pypy/rlib/ropenssl.py Mon Jun 11 23:15:04 2012 +0200
207 @@ -259,6 +259,7 @@
208 ssl_external('SSL_CIPHER_get_bits', [SSL_CIPHER, rffi.INTP], rffi.INT)
209
210 ssl_external('ERR_get_error', [], rffi.INT)
211 +ssl_external('ERR_peek_last_error', [], rffi.INT)
212 ssl_external('ERR_error_string', [rffi.ULONG, rffi.CCHARP], rffi.CCHARP)
213
214 ssl_external('SSL_free', [SSL], lltype.Void)
215
216
217
218 1.1 dev-python/pypy/files/1.9-ssl-threads-2-25cd11066d95.patch
219
220 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-ssl-threads-2-25cd11066d95.patch?rev=1.1&view=markup
221 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-ssl-threads-2-25cd11066d95.patch?rev=1.1&content-type=text/plain
222
223 Index: 1.9-ssl-threads-2-25cd11066d95.patch
224 ===================================================================
225 changeset: 55578:25cd11066d95
226 tag: tip
227 user: Armin Rigo <arigo@×××××.org>
228 date: Mon Jun 11 15:19:38 2012 +0200
229 summary: Fix.
230
231 diff -r e701bca5f3b9 -r 25cd11066d95 pypy/module/_ssl/thread_lock.py
232 --- a/pypy/module/_ssl/thread_lock.py Mon Jun 11 15:01:00 2012 +0200
233 +++ b/pypy/module/_ssl/thread_lock.py Mon Jun 11 15:19:38 2012 +0200
234 @@ -39,9 +39,9 @@
235 return;
236
237 if (mode & CRYPTO_LOCK) {
238 - RPyThreadAcquireLock(_ssl_locks[n], 1);
239 + RPyThreadAcquireLock(_ssl_locks + n, 1);
240 } else {
241 - RPyThreadReleaseLock(_ssl_locks[n]);
242 + RPyThreadReleaseLock(_ssl_locks + n);
243 }
244 }
245
246
247
248
249
250 1.1 dev-python/pypy/files/1.9-getargs-freelist-c26dc70ee340.patch
251
252 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-getargs-freelist-c26dc70ee340.patch?rev=1.1&view=markup
253 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-getargs-freelist-c26dc70ee340.patch?rev=1.1&content-type=text/plain
254
255 Index: 1.9-getargs-freelist-c26dc70ee340.patch
256 ===================================================================
257 # HG changeset patch
258 # User Armin Rigo <arigo@×××××.org>
259 # Date 1339595299 -7200
260 # Node ID c26dc70ee34018efeec8b789d40ec78478304bc0
261 # Parent c7dff5469611f03946466caed17c567c4ea5d8d0
262 Fix for the issue of abuse of PyCapsules, relying on immediate
263 destruction, as CPython does. This problem was first described in
264 https://bazaar.launchpad.net/~exarkun/pyopenssl/trunk/revision/166.
265 The fix is rather obvious and consist in a *negative* total amount
266 of lines :-/
267
268 diff -r c7dff5469611f03946466caed17c567c4ea5d8d0 -r c26dc70ee34018efeec8b789d40ec78478304bc0 pypy/module/cpyext/src/getargs.c
269 --- a/pypy/module/cpyext/src/getargs.c Wed Jun 13 13:19:05 2012 +0200
270 +++ b/pypy/module/cpyext/src/getargs.c Wed Jun 13 15:48:19 2012 +0200
271 @@ -24,14 +24,15 @@
272
273
274 /* Forward */
275 +typedef struct freelist_s freelist_t;
276 static int vgetargs1(PyObject *, const char *, va_list *, int);
277 static void seterror(int, const char *, int *, const char *, const char *);
278 static char *convertitem(PyObject *, const char **, va_list *, int, int *,
279 - char *, size_t, PyObject **);
280 + char *, size_t, freelist_t **);
281 static char *converttuple(PyObject *, const char **, va_list *, int,
282 - int *, char *, size_t, int, PyObject **);
283 + int *, char *, size_t, int, freelist_t **);
284 static char *convertsimple(PyObject *, const char **, va_list *, int, char *,
285 - size_t, PyObject **);
286 + size_t, freelist_t **);
287 static Py_ssize_t convertbuffer(PyObject *, void **p, char **);
288 static int getbuffer(PyObject *, Py_buffer *, char**);
289
290 @@ -128,72 +129,45 @@
291
292 /* Handle cleanup of allocated memory in case of exception */
293
294 -#define GETARGS_CAPSULE_NAME_CLEANUP_PTR "getargs.cleanup_ptr"
295 -#define GETARGS_CAPSULE_NAME_CLEANUP_BUFFER "getargs.cleanup_buffer"
296 +typedef void (*cleanup_fn)(void *);
297
298 -static void
299 -cleanup_ptr(PyObject *self)
300 -{
301 - void *ptr = PyCapsule_GetPointer(self, GETARGS_CAPSULE_NAME_CLEANUP_PTR);
302 - if (ptr) {
303 - PyMem_FREE(ptr);
304 - }
305 -}
306 +struct freelist_s {
307 + void *ptr;
308 + cleanup_fn destr;
309 + struct freelist_s *next;
310 +};
311
312 -static void
313 -cleanup_buffer(PyObject *self)
314 -{
315 - Py_buffer *ptr = (Py_buffer *)PyCapsule_GetPointer(self, GETARGS_CAPSULE_NAME_CLEANUP_BUFFER);
316 - if (ptr) {
317 - PyBuffer_Release(ptr);
318 - }
319 -}
320 +#define cleanup_ptr ((cleanup_fn)PyMem_FREE)
321 +#define cleanup_buffer ((cleanup_fn)PyBuffer_Release)
322
323 static int
324 -addcleanup(void *ptr, PyObject **freelist, PyCapsule_Destructor destr)
325 +addcleanup(void *ptr, freelist_t **freelist, cleanup_fn destr)
326 {
327 - PyObject *cobj;
328 - const char *name;
329 -
330 - if (!*freelist) {
331 - *freelist = PyList_New(0);
332 - if (!*freelist) {
333 - destr(ptr);
334 - return -1;
335 - }
336 - }
337 -
338 - if (destr == cleanup_ptr) {
339 - name = GETARGS_CAPSULE_NAME_CLEANUP_PTR;
340 - } else if (destr == cleanup_buffer) {
341 - name = GETARGS_CAPSULE_NAME_CLEANUP_BUFFER;
342 - } else {
343 - return -1;
344 - }
345 - cobj = PyCapsule_New(ptr, name, destr);
346 - if (!cobj) {
347 + freelist_t *node = PyMem_MALLOC(sizeof(freelist_t));
348 + if (!node) {
349 destr(ptr);
350 return -1;
351 }
352 - if (PyList_Append(*freelist, cobj)) {
353 - Py_DECREF(cobj);
354 - return -1;
355 - }
356 - Py_DECREF(cobj);
357 + node->ptr = ptr;
358 + node->destr = destr;
359 + node->next = *freelist;
360 + *freelist = node;
361 return 0;
362 }
363
364 static int
365 -cleanreturn(int retval, PyObject *freelist)
366 +cleanreturn(int retval, freelist_t *freelist)
367 {
368 - if (freelist && retval != 0) {
369 - /* We were successful, reset the destructors so that they
370 - don't get called. */
371 - Py_ssize_t len = PyList_GET_SIZE(freelist), i;
372 - for (i = 0; i < len; i++)
373 - PyCapsule_SetDestructor(PyList_GET_ITEM(freelist, i), NULL);
374 + freelist_t *next;
375 + while (freelist != NULL) {
376 + if (retval == 0) {
377 + /* Leaving with an error */
378 + freelist->destr(freelist->ptr);
379 + }
380 + next = freelist->next;
381 + PyMem_FREE(freelist);
382 + freelist = next;
383 }
384 - Py_XDECREF(freelist);
385 return retval;
386 }
387
388 @@ -212,7 +186,7 @@
389 const char *formatsave = format;
390 Py_ssize_t i, len;
391 char *msg;
392 - PyObject *freelist = NULL;
393 + freelist_t *freelist = NULL;
394 int compat = flags & FLAG_COMPAT;
395
396 assert(compat || (args != (PyObject*)NULL));
397 @@ -412,7 +386,7 @@
398 static char *
399 converttuple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
400 int *levels, char *msgbuf, size_t bufsize, int toplevel,
401 - PyObject **freelist)
402 + freelist_t **freelist)
403 {
404 int level = 0;
405 int n = 0;
406 @@ -488,7 +462,7 @@
407
408 static char *
409 convertitem(PyObject *arg, const char **p_format, va_list *p_va, int flags,
410 - int *levels, char *msgbuf, size_t bufsize, PyObject **freelist)
411 + int *levels, char *msgbuf, size_t bufsize, freelist_t **freelist)
412 {
413 char *msg;
414 const char *format = *p_format;
415 @@ -569,7 +543,7 @@
416
417 static char *
418 convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
419 - char *msgbuf, size_t bufsize, PyObject **freelist)
420 + char *msgbuf, size_t bufsize, freelist_t **freelist)
421 {
422 /* For # codes */
423 #define FETCH_SIZE int *q=NULL;Py_ssize_t *q2=NULL;\
424 @@ -1534,7 +1508,8 @@
425 const char *fname, *msg, *custom_msg, *keyword;
426 int min = INT_MAX;
427 int i, len, nargs, nkeywords;
428 - PyObject *freelist = NULL, *current_arg;
429 + freelist_t *freelist = NULL;
430 + PyObject *current_arg;
431
432 assert(args != NULL && PyTuple_Check(args));
433 assert(keywords == NULL || PyDict_Check(keywords));
434 diff -r c7dff5469611f03946466caed17c567c4ea5d8d0 -r c26dc70ee34018efeec8b789d40ec78478304bc0 pypy/module/cpyext/test/test_getargs.py
435 --- a/pypy/module/cpyext/test/test_getargs.py Wed Jun 13 13:19:05 2012 +0200
436 +++ b/pypy/module/cpyext/test/test_getargs.py Wed Jun 13 15:48:19 2012 +0200
437 @@ -144,6 +144,31 @@
438 assert 'foo\0bar\0baz' == pybuffer(buffer('foo\0bar\0baz'))
439
440
441 + def test_pyarg_parse_string_fails(self):
442 + """
443 + Test the failing case of PyArg_ParseTuple(): it must not keep
444 + a reference on the PyObject passed in.
445 + """
446 + pybuffer = self.import_parser(
447 + '''
448 + Py_buffer buf1, buf2, buf3;
449 + PyObject *result;
450 + if (!PyArg_ParseTuple(args, "s*s*s*", &buf1, &buf2, &buf3)) {
451 + return NULL;
452 + }
453 + Py_FatalError("should not get there");
454 + return NULL;
455 + ''')
456 + freed = []
457 + class freestring(str):
458 + def __del__(self):
459 + freed.append('x')
460 + raises(TypeError, pybuffer,
461 + freestring("string"), freestring("other string"), 42)
462 + import gc; gc.collect()
463 + assert freed == ['x', 'x']
464 +
465 +
466 def test_pyarg_parse_charbuf_and_length(self):
467 """
468 The `t#` format specifier can be used to parse a read-only 8-bit
469
470
471
472 1.1 dev-python/pypy/files/1.9-more-ignored-ops-146ddf82a279.patch
473
474 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-more-ignored-ops-146ddf82a279.patch?rev=1.1&view=markup
475 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-more-ignored-ops-146ddf82a279.patch?rev=1.1&content-type=text/plain
476
477 Index: 1.9-more-ignored-ops-146ddf82a279.patch
478 ===================================================================
479 changeset: 55567:146ddf82a279
480 user: Armin Rigo <arigo@×××××.org>
481 date: Mon Jun 11 10:33:19 2012 +0200
482 summary: More ignored ops
483
484 diff -r 04ea518e5b71 -r 146ddf82a279 pypy/translator/c/gcc/trackgcroot.py
485 --- a/pypy/translator/c/gcc/trackgcroot.py Mon Jun 11 10:28:26 2012 +0200
486 +++ b/pypy/translator/c/gcc/trackgcroot.py Mon Jun 11 10:33:19 2012 +0200
487 @@ -476,13 +476,13 @@
488 # floating-point operations cannot produce GC pointers
489 'f',
490 'cvt', 'ucomi', 'comi', 'subs', 'subp' , 'adds', 'addp', 'xorp',
491 - 'movap', 'movd', 'movlp', 'sqrtsd', 'movhpd',
492 + 'movap', 'movd', 'movlp', 'sqrt', 'rsqrt', 'movhpd',
493 'mins', 'minp', 'maxs', 'maxp', 'unpck', 'pxor', 'por', # sse2
494 'shufps', 'shufpd',
495 # arithmetic operations should not produce GC pointers
496 'inc', 'dec', 'not', 'neg', 'or', 'and', 'sbb', 'adc',
497 'shl', 'shr', 'sal', 'sar', 'rol', 'ror', 'mul', 'imul', 'div', 'idiv',
498 - 'bswap', 'bt', 'rdtsc',
499 + 'bswap', 'bt', 'rdtsc', 'rounds',
500 'pabs', 'pack', 'padd', 'palign', 'pand', 'pavg', 'pcmp', 'pextr',
501 'phadd', 'phsub', 'pinsr', 'pmadd', 'pmax', 'pmin', 'pmovmsk',
502 'pmul', 'por', 'psadb', 'pshuf', 'psign', 'psll', 'psra', 'psrl',
503
504
505
506
507 1.1 dev-python/pypy/files/1.9-ssl-threads-1-34b3b5aac082.patch
508
509 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-ssl-threads-1-34b3b5aac082.patch?rev=1.1&view=markup
510 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-ssl-threads-1-34b3b5aac082.patch?rev=1.1&content-type=text/plain
511
512 Index: 1.9-ssl-threads-1-34b3b5aac082.patch
513 ===================================================================
514 changeset: 55575:34b3b5aac082
515 parent: 55569:fa8262a5746a
516 user: Armin Rigo <arigo@×××××.org>
517 date: Mon Jun 11 14:38:35 2012 +0200
518 summary: Move the callback logic to C code instead of using RPython code
519
520 diff -r fa8262a5746a -r 34b3b5aac082 pypy/module/_ssl/__init__.py
521 --- a/pypy/module/_ssl/__init__.py Mon Jun 11 11:04:53 2012 +0200
522 +++ b/pypy/module/_ssl/__init__.py Mon Jun 11 14:38:35 2012 +0200
523 @@ -31,5 +31,6 @@
524 def startup(self, space):
525 from pypy.rlib.ropenssl import init_ssl
526 init_ssl()
527 - from pypy.module._ssl.interp_ssl import setup_ssl_threads
528 - setup_ssl_threads()
529 + if space.config.objspace.usemodules.thread:
530 + from pypy.module._ssl.thread_lock import setup_ssl_threads
531 + setup_ssl_threads()
532 diff -r fa8262a5746a -r 34b3b5aac082 pypy/module/_ssl/interp_ssl.py
533 --- a/pypy/module/_ssl/interp_ssl.py Mon Jun 11 11:04:53 2012 +0200
534 +++ b/pypy/module/_ssl/interp_ssl.py Mon Jun 11 14:38:35 2012 +0200
535 @@ -880,38 +880,3 @@
536 libssl_X509_free(x)
537 finally:
538 libssl_BIO_free(cert)
539 -
540 -# this function is needed to perform locking on shared data
541 -# structures. (Note that OpenSSL uses a number of global data
542 -# structures that will be implicitly shared whenever multiple threads
543 -# use OpenSSL.) Multi-threaded applications will crash at random if
544 -# it is not set.
545 -#
546 -# locking_function() must be able to handle up to CRYPTO_num_locks()
547 -# different mutex locks. It sets the n-th lock if mode & CRYPTO_LOCK, and
548 -# releases it otherwise.
549 -#
550 -# filename and line are the file number of the function setting the
551 -# lock. They can be useful for debugging.
552 -_ssl_locks = []
553 -
554 -def _ssl_thread_locking_function(mode, n, filename, line):
555 - n = intmask(n)
556 - if n < 0 or n >= len(_ssl_locks):
557 - return
558 -
559 - if intmask(mode) & CRYPTO_LOCK:
560 - _ssl_locks[n].acquire(True)
561 - else:
562 - _ssl_locks[n].release()
563 -
564 -def _ssl_thread_id_function():
565 - from pypy.module.thread import ll_thread
566 - return rffi.cast(rffi.LONG, ll_thread.get_ident())
567 -
568 -def setup_ssl_threads():
569 - from pypy.module.thread import ll_thread
570 - for i in range(libssl_CRYPTO_num_locks()):
571 - _ssl_locks.append(ll_thread.allocate_lock())
572 - libssl_CRYPTO_set_locking_callback(_ssl_thread_locking_function)
573 - libssl_CRYPTO_set_id_callback(_ssl_thread_id_function)
574 diff -r fa8262a5746a -r 34b3b5aac082 pypy/module/_ssl/thread_lock.py
575 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
576 +++ b/pypy/module/_ssl/thread_lock.py Mon Jun 11 14:38:35 2012 +0200
577 @@ -0,0 +1,78 @@
578 +from pypy.rlib.ropenssl import *
579 +from pypy.rpython.lltypesystem import lltype, rffi
580 +from pypy.translator.tool.cbuild import ExternalCompilationInfo
581 +
582 +# CRYPTO_set_locking_callback:
583 +#
584 +# this function is needed to perform locking on shared data
585 +# structures. (Note that OpenSSL uses a number of global data
586 +# structures that will be implicitly shared whenever multiple threads
587 +# use OpenSSL.) Multi-threaded applications will crash at random if
588 +# it is not set.
589 +#
590 +# locking_function() must be able to handle up to CRYPTO_num_locks()
591 +# different mutex locks. It sets the n-th lock if mode & CRYPTO_LOCK, and
592 +# releases it otherwise.
593 +#
594 +# filename and line are the file number of the function setting the
595 +# lock. They can be useful for debugging.
596 +
597 +
598 +# This logic is moved to C code so that the callbacks can be invoked
599 +# without caring about the GIL.
600 +
601 +separate_module_source = """
602 +
603 +#include <openssl/crypto.h>
604 +
605 +static unsigned int _ssl_locks_count = 0;
606 +static struct RPyOpaque_ThreadLock *_ssl_locks;
607 +
608 +static unsigned long _ssl_thread_id_function(void) {
609 + return RPyThreadGetIdent();
610 +}
611 +
612 +static void _ssl_thread_locking_function(int mode, int n, const char *file,
613 + int line) {
614 + if ((_ssl_locks == NULL) ||
615 + (n < 0) || ((unsigned)n >= _ssl_locks_count))
616 + return;
617 +
618 + if (mode & CRYPTO_LOCK) {
619 + RPyThreadAcquireLock(_ssl_locks[n], 1);
620 + } else {
621 + RPyThreadReleaseLock(_ssl_locks[n]);
622 + }
623 +}
624 +
625 +int _PyPy_SSL_SetupThreads(void)
626 +{
627 + unsigned int i;
628 + _ssl_locks_count = CRYPTO_num_locks();
629 + _ssl_locks = calloc(_ssl_locks_count, sizeof(struct RPyOpaque_ThreadLock));
630 + if (_ssl_locks == NULL)
631 + return 0;
632 + for (i=0; i<_ssl_locks_count; i++) {
633 + if (RPyThreadLockInit(_ssl_locks + i) == 0)
634 + return 0;
635 + }
636 + CRYPTO_set_locking_callback(_ssl_thread_locking_function);
637 + CRYPTO_set_id_callback(_ssl_thread_id_function);
638 + return 1;
639 +}
640 +"""
641 +
642 +
643 +eci = ExternalCompilationInfo(
644 + separate_module_sources=[separate_module_source],
645 + export_symbols=['_PyPy_SSL_SetupThreads'],
646 +)
647 +
648 +_PyPy_SSL_SetupThreads = rffi.llexternal('_PyPy_SSL_SetupThreads',
649 + [], rffi.INT,
650 + compilation_info=eci)
651 +
652 +def setup_ssl_threads():
653 + result = _PyPy_SSL_SetupThreads()
654 + if rffi.cast(lltype.Signed, result) == 0:
655 + raise MemoryError
656
657
658
659
660 1.1 dev-python/pypy/files/1.9-signal-a33052b17f4e.patch
661
662 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-signal-a33052b17f4e.patch?rev=1.1&view=markup
663 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy/files/1.9-signal-a33052b17f4e.patch?rev=1.1&content-type=text/plain
664
665 Index: 1.9-signal-a33052b17f4e.patch
666 ===================================================================
667 changeset: 55595:a33052b17f4e
668 parent: 55589:4f58f2db96c0
669 user: Armin Rigo <arigo@×××××.org>
670 date: Mon Jun 11 18:06:35 2012 +0200
671 summary: issue1167: changed the test (according to py.test -A on Linux), and fix
672
673 diff -r 4f58f2db96c0 -r a33052b17f4e pypy/module/signal/interp_signal.py
674 --- a/pypy/module/signal/interp_signal.py Mon Jun 11 17:05:01 2012 +0200
675 +++ b/pypy/module/signal/interp_signal.py Mon Jun 11 18:06:35 2012 +0200
676 @@ -227,7 +227,7 @@
677 None -- if an unknown handler is in effect (XXX UNIMPLEMENTED)
678 anything else -- the callable Python object used as a handler
679 """
680 - check_signum(space, signum)
681 + check_signum_in_range(space, signum)
682 action = space.check_signal_action
683 if signum in action.handlers_w:
684 return action.handlers_w[signum]
685 @@ -253,12 +253,18 @@
686 c_pause()
687 return space.w_None
688
689 -def check_signum(space, signum):
690 +def check_signum_exists(space, signum):
691 if signum in signal_values:
692 return
693 raise OperationError(space.w_ValueError,
694 space.wrap("invalid signal value"))
695
696 +def check_signum_in_range(space, signum):
697 + if 1 <= signum < NSIG:
698 + return
699 + raise OperationError(space.w_ValueError,
700 + space.wrap("signal number out of range"))
701 +
702
703 @jit.dont_look_inside
704 @unwrap_spec(signum=int)
705 @@ -319,7 +325,7 @@
706
707 @unwrap_spec(signum=int, flag=int)
708 def siginterrupt(space, signum, flag):
709 - check_signum(space, signum)
710 + check_signum_exists(space, signum)
711 if rffi.cast(lltype.Signed, c_siginterrupt(signum, flag)) < 0:
712 errno = rposix.get_errno()
713 raise OperationError(space.w_RuntimeError, space.wrap(errno))
714 diff -r 4f58f2db96c0 -r a33052b17f4e pypy/module/signal/test/test_signal.py
715 --- a/pypy/module/signal/test/test_signal.py Mon Jun 11 17:05:01 2012 +0200
716 +++ b/pypy/module/signal/test/test_signal.py Mon Jun 11 18:06:35 2012 +0200
717 @@ -154,7 +154,12 @@
718
719 raises(ValueError, getsignal, 4444)
720 raises(ValueError, signal, 4444, lambda *args: None)
721 - raises(ValueError, signal, 42, lambda *args: None)
722 + import sys
723 + if sys.platform == 'win32':
724 + raises(ValueError, signal, 42, lambda *args: None)
725 + else:
726 + signal(42, lambda *args: None)
727 + signal(42, SIG_DFL)
728
729 def test_alarm(self):
730 try: