Gentoo Archives: gentoo-commits

From: "Michal Gorny (mgorny)" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-python/pypy-bin/files: 1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch 1.9-ssl-threads-2-25cd11066d95.patch 2.0.2-distutils-fix_handling_of_executables_and_flags.patch 1.9-pybuffer-release-double-decref-4ec2a5b49386.patch 1.9-scripts-location.patch 1.9-more-ignored-ops-a9a8faa76bca.patch 1.9-getargs-freelist-c26dc70ee340.patch 1.9-no-bytecode-4151f9c406b6.patch 1.9-distutils-fix_handling_of_executables_and_flags.patch 1.9-ssl-errors-25d3418150d2.patch 1.9-no-static-hack.patch 1.9-get_python_lib_standard_lib-04ea518e5b71.patch 1.9-more-ignored-ops-146ddf82a279.patch 1.9-ssl-threads-1-34b3b5aac082.patch 1.9-signal-a33052b17f4e.patch
Date: Sat, 27 Jul 2013 11:19:29
Message-Id: 20130727111919.7F93A21710@flycatcher.gentoo.org
1 mgorny 13/07/27 11:19:19
2
3 Added:
4 1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch
5 1.9-ssl-threads-2-25cd11066d95.patch
6 2.0.2-distutils-fix_handling_of_executables_and_flags.patch
7 1.9-pybuffer-release-double-decref-4ec2a5b49386.patch
8 1.9-scripts-location.patch
9 1.9-more-ignored-ops-a9a8faa76bca.patch
10 1.9-getargs-freelist-c26dc70ee340.patch
11 1.9-no-bytecode-4151f9c406b6.patch
12 1.9-distutils-fix_handling_of_executables_and_flags.patch
13 1.9-ssl-errors-25d3418150d2.patch
14 1.9-no-static-hack.patch
15 1.9-get_python_lib_standard_lib-04ea518e5b71.patch
16 1.9-more-ignored-ops-146ddf82a279.patch
17 1.9-ssl-threads-1-34b3b5aac082.patch
18 1.9-signal-a33052b17f4e.patch
19 Log:
20 Initial versions of pypy binary packages.
21
22 (Portage version: 2.2.0_alpha190/cvs/Linux x86_64, signed Manifest commit with key 9627F456F9DA7643!)
23
24 Revision Changes Path
25 1.1 dev-python/pypy-bin/files/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch
26
27 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch?rev=1.1&view=markup
28 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch?rev=1.1&content-type=text/plain
29
30 Index: 1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch
31 ===================================================================
32 --- lib-python/2.7/distutils/unixccompiler.py
33 +++ lib-python/2.7/distutils/unixccompiler.py
34 @@ -297,7 +297,7 @@
35 # this time, there's no way to determine this information from
36 # the configuration data stored in the Python installation, so
37 # we use this hack.
38 - compiler = os.path.basename(sysconfig.get_config_var("CC"))
39 + compiler = os.path.basename(self.compiler[0])
40 if sys.platform[:6] == "darwin":
41 # MacOSX's linker doesn't understand the -R flag at all
42 return "-L" + dir
43
44
45
46 1.1 dev-python/pypy-bin/files/1.9-ssl-threads-2-25cd11066d95.patch
47
48 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-ssl-threads-2-25cd11066d95.patch?rev=1.1&view=markup
49 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-ssl-threads-2-25cd11066d95.patch?rev=1.1&content-type=text/plain
50
51 Index: 1.9-ssl-threads-2-25cd11066d95.patch
52 ===================================================================
53 changeset: 55578:25cd11066d95
54 tag: tip
55 user: Armin Rigo <arigo@×××××.org>
56 date: Mon Jun 11 15:19:38 2012 +0200
57 summary: Fix.
58
59 diff -r e701bca5f3b9 -r 25cd11066d95 pypy/module/_ssl/thread_lock.py
60 --- a/pypy/module/_ssl/thread_lock.py Mon Jun 11 15:01:00 2012 +0200
61 +++ b/pypy/module/_ssl/thread_lock.py Mon Jun 11 15:19:38 2012 +0200
62 @@ -39,9 +39,9 @@
63 return;
64
65 if (mode & CRYPTO_LOCK) {
66 - RPyThreadAcquireLock(_ssl_locks[n], 1);
67 + RPyThreadAcquireLock(_ssl_locks + n, 1);
68 } else {
69 - RPyThreadReleaseLock(_ssl_locks[n]);
70 + RPyThreadReleaseLock(_ssl_locks + n);
71 }
72 }
73
74
75
76
77
78 1.1 dev-python/pypy-bin/files/2.0.2-distutils-fix_handling_of_executables_and_flags.patch
79
80 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/2.0.2-distutils-fix_handling_of_executables_and_flags.patch?rev=1.1&view=markup
81 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/2.0.2-distutils-fix_handling_of_executables_and_flags.patch?rev=1.1&content-type=text/plain
82
83 Index: 2.0.2-distutils-fix_handling_of_executables_and_flags.patch
84 ===================================================================
85 http://bugs.python.org/issue1222585
86
87 --- lib-python/2.7/distutils/cygwinccompiler.py
88 +++ lib-python/2.7/distutils/cygwinccompiler.py
89 @@ -132,9 +132,13 @@
90 self.set_executables(compiler='gcc -mcygwin -O -Wall',
91 compiler_so='gcc -mcygwin -mdll -O -Wall',
92 compiler_cxx='g++ -mcygwin -O -Wall',
93 + compiler_so_cxx='g++ -mcygwin -mdll -O -Wall',
94 linker_exe='gcc -mcygwin',
95 linker_so=('%s -mcygwin %s' %
96 - (self.linker_dll, shared_option)))
97 + (self.linker_dll, shared_option)),
98 + linker_exe_cxx='g++ -mcygwin',
99 + linker_so_cxx=('%s -mcygwin %s' %
100 + (self.linker_dll, shared_option)))
101
102 # cygwin and mingw32 need different sets of libraries
103 if self.gcc_version == "2.91.57":
104 @@ -160,8 +164,12 @@
105 raise CompileError, msg
106 else: # for other files use the C-compiler
107 try:
108 - self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
109 - extra_postargs)
110 + if self.detect_language(src) == 'c++':
111 + self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
112 + extra_postargs)
113 + else:
114 + self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
115 + extra_postargs)
116 except DistutilsExecError, msg:
117 raise CompileError, msg
118
119 @@ -322,10 +330,15 @@
120 self.set_executables(compiler='gcc -mno-cygwin -O -Wall',
121 compiler_so='gcc -mno-cygwin -mdll -O -Wall',
122 compiler_cxx='g++ -mno-cygwin -O -Wall',
123 + compiler_so_cxx='g++ -mno-cygwin -mdll -O -Wall',
124 linker_exe='gcc -mno-cygwin',
125 linker_so='%s -mno-cygwin %s %s'
126 % (self.linker_dll, shared_option,
127 - entry_point))
128 + entry_point),
129 + linker_exe_cxx='g++ -mno-cygwin',
130 + linker_so_cxx='%s -mno-cygwin %s %s'
131 + % (self.linker_dll, shared_option,
132 + entry_point))
133 # Maybe we should also append -mthreads, but then the finished
134 # dlls need another dll (mingwm10.dll see Mingw32 docs)
135 # (-mthreads: Support thread-safe exception handling on `Mingw32')
136 --- lib-python/2.7/distutils/emxccompiler.py
137 +++ lib-python/2.7/distutils/emxccompiler.py
138 @@ -65,8 +65,12 @@
139 # XXX optimization, warnings etc. should be customizable.
140 self.set_executables(compiler='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
141 compiler_so='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
142 + compiler_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
143 + compiler_so_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
144 linker_exe='gcc -Zomf -Zmt -Zcrtdll',
145 - linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll')
146 + linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll',
147 + linker_exe_cxx='g++ -Zomf -Zmt -Zcrtdll',
148 + linker_so_cxx='g++ -Zomf -Zmt -Zcrtdll -Zdll')
149
150 # want the gcc library statically linked (so that we don't have
151 # to distribute a version dependent on the compiler we have)
152 @@ -83,8 +87,12 @@
153 raise CompileError, msg
154 else: # for other files use the C-compiler
155 try:
156 - self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
157 - extra_postargs)
158 + if self.detect_language(src) == 'c++':
159 + self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
160 + extra_postargs)
161 + else:
162 + self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
163 + extra_postargs)
164 except DistutilsExecError, msg:
165 raise CompileError, msg
166
167 --- lib-python/2.7/distutils/sysconfig_cpython.py
168 +++ lib-python/2.7/distutils/sysconfig_cpython.py
169 @@ -150,10 +150,12 @@
170 varies across Unices and is stored in Python's Makefile.
171 """
172 if compiler.compiler_type == "unix":
173 - (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \
174 - get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
175 - 'CCSHARED', 'LDSHARED', 'SO', 'AR',
176 - 'ARFLAGS')
177 + (cc, cxx, ccshared, ldshared, ldcxxshared, so_ext, ar, ar_flags) = \
178 + get_config_vars('CC', 'CXX', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED',
179 + 'SO', 'AR', 'ARFLAGS')
180 +
181 + cflags = ''
182 + cxxflags = ''
183
184 newcc = None
185 if 'CC' in os.environ:
186 @@ -191,19 +193,27 @@
187 cxx = os.environ['CXX']
188 if 'LDSHARED' in os.environ:
189 ldshared = os.environ['LDSHARED']
190 + if 'LDCXXSHARED' in os.environ:
191 + ldcxxshared = os.environ['LDCXXSHARED']
192 if 'CPP' in os.environ:
193 cpp = os.environ['CPP']
194 else:
195 cpp = cc + " -E" # not always
196 if 'LDFLAGS' in os.environ:
197 ldshared = ldshared + ' ' + os.environ['LDFLAGS']
198 + ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
199 if 'CFLAGS' in os.environ:
200 - cflags = opt + ' ' + os.environ['CFLAGS']
201 + cflags = os.environ['CFLAGS']
202 ldshared = ldshared + ' ' + os.environ['CFLAGS']
203 + if 'CXXFLAGS' in os.environ:
204 + cxxflags = os.environ['CXXFLAGS']
205 + ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
206 if 'CPPFLAGS' in os.environ:
207 cpp = cpp + ' ' + os.environ['CPPFLAGS']
208 cflags = cflags + ' ' + os.environ['CPPFLAGS']
209 + cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
210 ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
211 + ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
212 if 'AR' in os.environ:
213 ar = os.environ['AR']
214 if 'ARFLAGS' in os.environ:
215 @@ -212,13 +222,17 @@
216 archiver = ar + ' ' + ar_flags
217
218 cc_cmd = cc + ' ' + cflags
219 + cxx_cmd = cxx + ' ' + cxxflags
220 compiler.set_executables(
221 preprocessor=cpp,
222 compiler=cc_cmd,
223 compiler_so=cc_cmd + ' ' + ccshared,
224 - compiler_cxx=cxx,
225 + compiler_cxx=cxx_cmd,
226 + compiler_so_cxx=cxx_cmd + ' ' + ccshared,
227 linker_so=ldshared,
228 linker_exe=cc,
229 + linker_so_cxx=ldcxxshared,
230 + linker_exe_cxx=cxx,
231 archiver=archiver)
232
233 compiler.shared_lib_extension = so_ext
234 @@ -530,7 +544,7 @@
235 for key in ('LDFLAGS', 'BASECFLAGS', 'LDSHARED',
236 # a number of derived variables. These need to be
237 # patched up as well.
238 - 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
239 + 'CFLAGS', 'CXXFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
240 flags = _config_vars[key]
241 flags = re.sub('-arch\s+\w+\s', ' ', flags)
242 flags = re.sub('-isysroot [^ \t]*', ' ', flags)
243 @@ -549,7 +563,7 @@
244 for key in ('LDFLAGS', 'BASECFLAGS', 'LDSHARED',
245 # a number of derived variables. These need to be
246 # patched up as well.
247 - 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
248 + 'CFLAGS', 'CXXFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
249
250 flags = _config_vars[key]
251 flags = re.sub('-arch\s+\w+\s', ' ', flags)
252 @@ -573,7 +587,7 @@
253 for key in ('LDFLAGS', 'BASECFLAGS', 'LDSHARED',
254 # a number of derived variables. These need to be
255 # patched up as well.
256 - 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
257 + 'CFLAGS', 'CXXFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
258
259 flags = _config_vars[key]
260 flags = re.sub('-isysroot\s+\S+(\s|$)', ' ', flags)
261 --- lib-python/2.7/distutils/sysconfig_pypy.py
262 +++ lib-python/2.7/distutils/sysconfig_pypy.py
263 @@ -114,13 +114,56 @@
264 optional C speedup components.
265 """
266 if compiler.compiler_type == "unix":
267 - compiler.compiler_so.extend(['-O2', '-fPIC', '-Wimplicit'])
268 + cc = ' '.join(compiler.compiler)
269 + cxx = ' '.join(compiler.compiler_cxx)
270 + ldshared = ' '.join(compiler.linker_so)
271 + ldcxxshared = ' '.join(compiler.linker_so_cxx)
272 +
273 + cflags = ''
274 + cxxflags = ''
275 + ccshared = '-fPIC'
276 +
277 + if 'CC' in os.environ:
278 + cc = os.environ['CC']
279 + if 'CXX' in os.environ:
280 + cxx = os.environ['CXX']
281 + if 'LDSHARED' in os.environ:
282 + ldshared = os.environ['LDSHARED']
283 + if 'LDCXXSHARED' in os.environ:
284 + ldcxxshared = os.environ['LDCXXSHARED']
285 + if 'CPP' in os.environ:
286 + cpp = os.environ['CPP']
287 + else:
288 + cpp = cc + " -E" # not always
289 + if 'LDFLAGS' in os.environ:
290 + ldshared = ldshared + ' ' + os.environ['LDFLAGS']
291 + ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
292 + if 'CFLAGS' in os.environ:
293 + cflags = os.environ['CFLAGS']
294 + ldshared = ldshared + ' ' + os.environ['CFLAGS']
295 + if 'CXXFLAGS' in os.environ:
296 + cxxflags = os.environ['CXXFLAGS']
297 + ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
298 + if 'CPPFLAGS' in os.environ:
299 + cpp = cpp + ' ' + os.environ['CPPFLAGS']
300 + cflags = cflags + ' ' + os.environ['CPPFLAGS']
301 + cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
302 + ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
303 + ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
304 +
305 + cc_cmd = cc + ' ' + cflags
306 + cxx_cmd = cxx + ' ' + cxxflags
307 + compiler.set_executables(
308 + preprocessor=cpp,
309 + compiler=cc_cmd,
310 + compiler_so=cc_cmd + ' ' + ccshared,
311 + compiler_cxx=cxx_cmd,
312 + compiler_so_cxx=cxx_cmd + ' ' + ccshared,
313 + linker_so=ldshared,
314 + linker_exe=cc,
315 + linker_so_cxx=ldcxxshared,
316 + linker_exe_cxx=cxx)
317 compiler.shared_lib_extension = get_config_var('SO')
318 - if "CFLAGS" in os.environ:
319 - cflags = os.environ["CFLAGS"]
320 - compiler.compiler.append(cflags)
321 - compiler.compiler_so.append(cflags)
322 - compiler.linker_so.append(cflags)
323
324
325 from sysconfig_cpython import (
326 --- lib-python/2.7/distutils/unixccompiler.py
327 +++ lib-python/2.7/distutils/unixccompiler.py
328 @@ -114,14 +114,17 @@
329 # are pretty generic; they will probably have to be set by an outsider
330 # (eg. using information discovered by the sysconfig about building
331 # Python extensions).
332 - executables = {'preprocessor' : None,
333 - 'compiler' : ["cc"],
334 - 'compiler_so' : ["cc"],
335 - 'compiler_cxx' : ["cc"],
336 - 'linker_so' : ["cc", "-shared"],
337 - 'linker_exe' : ["cc"],
338 - 'archiver' : ["ar", "-cr"],
339 - 'ranlib' : None,
340 + executables = {'preprocessor' : None,
341 + 'compiler' : ["cc"],
342 + 'compiler_so' : ["cc"],
343 + 'compiler_cxx' : ["c++"],
344 + 'compiler_so_cxx' : ["c++"],
345 + 'linker_so' : ["cc", "-shared"],
346 + 'linker_exe' : ["cc"],
347 + 'linker_so_cxx' : ["c++", "-shared"],
348 + 'linker_exe_cxx' : ["c++"],
349 + 'archiver' : ["ar", "-cr"],
350 + 'ranlib' : None,
351 }
352
353 if sys.platform[:6] == "darwin":
354 @@ -171,11 +174,18 @@
355
356 def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
357 compiler_so = self.compiler_so
358 + compiler_so_cxx = self.compiler_so_cxx
359 if sys.platform == 'darwin':
360 compiler_so = _darwin_compiler_fixup(compiler_so, cc_args + extra_postargs)
361 + compiler_so_cxx = _darwin_compiler_fixup(compiler_so_cxx, cc_args +
362 + extra_postargs)
363 try:
364 - self.spawn(compiler_so + cc_args + [src, '-o', obj] +
365 - extra_postargs)
366 + if self.detect_language(src) == 'c++':
367 + self.spawn(compiler_so_cxx + cc_args + [src, '-o', obj] +
368 + extra_postargs)
369 + else:
370 + self.spawn(compiler_so + cc_args + [src, '-o', obj] +
371 + extra_postargs)
372 except DistutilsExecError, msg:
373 raise CompileError, msg
374
375 @@ -232,23 +242,16 @@
376 ld_args.extend(extra_postargs)
377 self.mkpath(os.path.dirname(output_filename))
378 try:
379 - if target_desc == CCompiler.EXECUTABLE:
380 - linker = self.linker_exe[:]
381 + if target_lang == "c++":
382 + if target_desc == CCompiler.EXECUTABLE:
383 + linker = self.linker_exe_cxx[:]
384 + else:
385 + linker = self.linker_so_cxx[:]
386 else:
387 - linker = self.linker_so[:]
388 - if target_lang == "c++" and self.compiler_cxx:
389 - # skip over environment variable settings if /usr/bin/env
390 - # is used to set up the linker's environment.
391 - # This is needed on OSX. Note: this assumes that the
392 - # normal and C++ compiler have the same environment
393 - # settings.
394 - i = 0
395 - if os.path.basename(linker[0]) == "env":
396 - i = 1
397 - while '=' in linker[i]:
398 - i = i + 1
399 -
400 - linker[i] = self.compiler_cxx[i]
401 + if target_desc == CCompiler.EXECUTABLE:
402 + linker = self.linker_exe[:]
403 + else:
404 + linker = self.linker_so[:]
405
406 if sys.platform == 'darwin':
407 linker = _darwin_compiler_fixup(linker, ld_args)
408
409
410
411 1.1 dev-python/pypy-bin/files/1.9-pybuffer-release-double-decref-4ec2a5b49386.patch
412
413 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-pybuffer-release-double-decref-4ec2a5b49386.patch?rev=1.1&view=markup
414 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-pybuffer-release-double-decref-4ec2a5b49386.patch?rev=1.1&content-type=text/plain
415
416 Index: 1.9-pybuffer-release-double-decref-4ec2a5b49386.patch
417 ===================================================================
418 changeset: 55598:4ec2a5b49386
419 tag: tip
420 user: Armin Rigo <arigo@×××××.org>
421 date: Mon Jun 11 19:54:04 2012 +0200
422 summary: Test and fix (thanks marienz)
423
424 diff -r cdb2d1b3d0da -r 4ec2a5b49386 pypy/module/cpyext/object.py
425 --- a/pypy/module/cpyext/object.py Mon Jun 11 19:41:35 2012 +0200
426 +++ b/pypy/module/cpyext/object.py Mon Jun 11 19:54:04 2012 +0200
427 @@ -489,3 +489,4 @@
428 provides a subset of CPython's behavior.
429 """
430 Py_DecRef(space, view.c_obj)
431 + view.c_obj = lltype.nullptr(PyObject.TO)
432 diff -r cdb2d1b3d0da -r 4ec2a5b49386 pypy/module/cpyext/test/test_object.py
433 --- a/pypy/module/cpyext/test/test_object.py Mon Jun 11 19:41:35 2012 +0200
434 +++ b/pypy/module/cpyext/test/test_object.py Mon Jun 11 19:54:04 2012 +0200
435 @@ -363,6 +363,10 @@
436 * Py_buffer and the string should be released as well.
437 */
438 PyBuffer_Release(&buf);
439 + assert(!buf.obj);
440 + PyBuffer_Release(&buf); /* call again, should not have any more effect */
441 + PyBuffer_Release(&buf);
442 + PyBuffer_Release(&buf);
443
444 Py_RETURN_NONE;
445 """)])
446
447
448
449
450 1.1 dev-python/pypy-bin/files/1.9-scripts-location.patch
451
452 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-scripts-location.patch?rev=1.1&view=markup
453 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-scripts-location.patch?rev=1.1&content-type=text/plain
454
455 Index: 1.9-scripts-location.patch
456 ===================================================================
457 --- pypy-pypy-release-1.7/lib-python/2.7/distutils/command/install.py
458 +++ pypy-pypy-release-1.7/lib-python/2.7/distutils/command/install.py
459 @@ -87,7 +87,7 @@
460 'purelib': '$base/site-packages',
461 'platlib': '$base/site-packages',
462 'headers': '$base/include',
463 - 'scripts': '$base/bin',
464 + 'scripts': '/usr/bin',
465 'data' : '$base',
466 },
467 }
468
469
470
471 1.1 dev-python/pypy-bin/files/1.9-more-ignored-ops-a9a8faa76bca.patch
472
473 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-more-ignored-ops-a9a8faa76bca.patch?rev=1.1&view=markup
474 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-more-ignored-ops-a9a8faa76bca.patch?rev=1.1&content-type=text/plain
475
476 Index: 1.9-more-ignored-ops-a9a8faa76bca.patch
477 ===================================================================
478 changeset: 55523:a9a8faa76bca
479 parent: 55518:f0daafccddc5
480 user: Armin Rigo <arigo@×××××.org>
481 date: Fri Jun 08 19:55:01 2012 +0200
482 summary: Add more instructions to ignore by copying from Intel docs.
483
484 diff -r f0daafccddc5 -r a9a8faa76bca pypy/translator/c/gcc/trackgcroot.py
485 --- a/pypy/translator/c/gcc/trackgcroot.py Fri Jun 08 18:30:54 2012 +0200
486 +++ b/pypy/translator/c/gcc/trackgcroot.py Fri Jun 08 19:55:01 2012 +0200
487 @@ -483,8 +483,10 @@
488 'inc', 'dec', 'not', 'neg', 'or', 'and', 'sbb', 'adc',
489 'shl', 'shr', 'sal', 'sar', 'rol', 'ror', 'mul', 'imul', 'div', 'idiv',
490 'bswap', 'bt', 'rdtsc',
491 - 'punpck', 'pshufd', 'pcmp', 'pand', 'psllw', 'pslld', 'psllq',
492 - 'paddq', 'pinsr', 'pmul', 'psrl',
493 + 'pabs', 'pack', 'padd', 'palign', 'pand', 'pavg', 'pcmp', 'pextr',
494 + 'phadd', 'phsub', 'pinsr', 'pmadd', 'pmax', 'pmin', 'pmovmsk',
495 + 'pmul', 'por', 'psadb', 'pshuf', 'psign', 'psll', 'psra', 'psrl',
496 + 'psub', 'punpck', 'pxor',
497 # all vectors don't produce pointers
498 'v',
499 # sign-extending moves should not produce GC pointers
500 @@ -492,7 +494,7 @@
501 # zero-extending moves should not produce GC pointers
502 'movz',
503 # locked operations should not move GC pointers, at least so far
504 - 'lock',
505 + 'lock', 'pause',
506 ])
507
508 # a partial list is hopefully good enough for now; it's all to support
509
510
511
512
513 1.1 dev-python/pypy-bin/files/1.9-getargs-freelist-c26dc70ee340.patch
514
515 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-getargs-freelist-c26dc70ee340.patch?rev=1.1&view=markup
516 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-getargs-freelist-c26dc70ee340.patch?rev=1.1&content-type=text/plain
517
518 Index: 1.9-getargs-freelist-c26dc70ee340.patch
519 ===================================================================
520 # HG changeset patch
521 # User Armin Rigo <arigo@×××××.org>
522 # Date 1339595299 -7200
523 # Node ID c26dc70ee34018efeec8b789d40ec78478304bc0
524 # Parent c7dff5469611f03946466caed17c567c4ea5d8d0
525 Fix for the issue of abuse of PyCapsules, relying on immediate
526 destruction, as CPython does. This problem was first described in
527 https://bazaar.launchpad.net/~exarkun/pyopenssl/trunk/revision/166.
528 The fix is rather obvious and consist in a *negative* total amount
529 of lines :-/
530
531 diff -r c7dff5469611f03946466caed17c567c4ea5d8d0 -r c26dc70ee34018efeec8b789d40ec78478304bc0 pypy/module/cpyext/src/getargs.c
532 --- a/pypy/module/cpyext/src/getargs.c Wed Jun 13 13:19:05 2012 +0200
533 +++ b/pypy/module/cpyext/src/getargs.c Wed Jun 13 15:48:19 2012 +0200
534 @@ -24,14 +24,15 @@
535
536
537 /* Forward */
538 +typedef struct freelist_s freelist_t;
539 static int vgetargs1(PyObject *, const char *, va_list *, int);
540 static void seterror(int, const char *, int *, const char *, const char *);
541 static char *convertitem(PyObject *, const char **, va_list *, int, int *,
542 - char *, size_t, PyObject **);
543 + char *, size_t, freelist_t **);
544 static char *converttuple(PyObject *, const char **, va_list *, int,
545 - int *, char *, size_t, int, PyObject **);
546 + int *, char *, size_t, int, freelist_t **);
547 static char *convertsimple(PyObject *, const char **, va_list *, int, char *,
548 - size_t, PyObject **);
549 + size_t, freelist_t **);
550 static Py_ssize_t convertbuffer(PyObject *, void **p, char **);
551 static int getbuffer(PyObject *, Py_buffer *, char**);
552
553 @@ -128,72 +129,45 @@
554
555 /* Handle cleanup of allocated memory in case of exception */
556
557 -#define GETARGS_CAPSULE_NAME_CLEANUP_PTR "getargs.cleanup_ptr"
558 -#define GETARGS_CAPSULE_NAME_CLEANUP_BUFFER "getargs.cleanup_buffer"
559 +typedef void (*cleanup_fn)(void *);
560
561 -static void
562 -cleanup_ptr(PyObject *self)
563 -{
564 - void *ptr = PyCapsule_GetPointer(self, GETARGS_CAPSULE_NAME_CLEANUP_PTR);
565 - if (ptr) {
566 - PyMem_FREE(ptr);
567 - }
568 -}
569 +struct freelist_s {
570 + void *ptr;
571 + cleanup_fn destr;
572 + struct freelist_s *next;
573 +};
574
575 -static void
576 -cleanup_buffer(PyObject *self)
577 -{
578 - Py_buffer *ptr = (Py_buffer *)PyCapsule_GetPointer(self, GETARGS_CAPSULE_NAME_CLEANUP_BUFFER);
579 - if (ptr) {
580 - PyBuffer_Release(ptr);
581 - }
582 -}
583 +#define cleanup_ptr ((cleanup_fn)PyMem_FREE)
584 +#define cleanup_buffer ((cleanup_fn)PyBuffer_Release)
585
586 static int
587 -addcleanup(void *ptr, PyObject **freelist, PyCapsule_Destructor destr)
588 +addcleanup(void *ptr, freelist_t **freelist, cleanup_fn destr)
589 {
590 - PyObject *cobj;
591 - const char *name;
592 -
593 - if (!*freelist) {
594 - *freelist = PyList_New(0);
595 - if (!*freelist) {
596 - destr(ptr);
597 - return -1;
598 - }
599 - }
600 -
601 - if (destr == cleanup_ptr) {
602 - name = GETARGS_CAPSULE_NAME_CLEANUP_PTR;
603 - } else if (destr == cleanup_buffer) {
604 - name = GETARGS_CAPSULE_NAME_CLEANUP_BUFFER;
605 - } else {
606 - return -1;
607 - }
608 - cobj = PyCapsule_New(ptr, name, destr);
609 - if (!cobj) {
610 + freelist_t *node = PyMem_MALLOC(sizeof(freelist_t));
611 + if (!node) {
612 destr(ptr);
613 return -1;
614 }
615 - if (PyList_Append(*freelist, cobj)) {
616 - Py_DECREF(cobj);
617 - return -1;
618 - }
619 - Py_DECREF(cobj);
620 + node->ptr = ptr;
621 + node->destr = destr;
622 + node->next = *freelist;
623 + *freelist = node;
624 return 0;
625 }
626
627 static int
628 -cleanreturn(int retval, PyObject *freelist)
629 +cleanreturn(int retval, freelist_t *freelist)
630 {
631 - if (freelist && retval != 0) {
632 - /* We were successful, reset the destructors so that they
633 - don't get called. */
634 - Py_ssize_t len = PyList_GET_SIZE(freelist), i;
635 - for (i = 0; i < len; i++)
636 - PyCapsule_SetDestructor(PyList_GET_ITEM(freelist, i), NULL);
637 + freelist_t *next;
638 + while (freelist != NULL) {
639 + if (retval == 0) {
640 + /* Leaving with an error */
641 + freelist->destr(freelist->ptr);
642 + }
643 + next = freelist->next;
644 + PyMem_FREE(freelist);
645 + freelist = next;
646 }
647 - Py_XDECREF(freelist);
648 return retval;
649 }
650
651 @@ -212,7 +186,7 @@
652 const char *formatsave = format;
653 Py_ssize_t i, len;
654 char *msg;
655 - PyObject *freelist = NULL;
656 + freelist_t *freelist = NULL;
657 int compat = flags & FLAG_COMPAT;
658
659 assert(compat || (args != (PyObject*)NULL));
660 @@ -412,7 +386,7 @@
661 static char *
662 converttuple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
663 int *levels, char *msgbuf, size_t bufsize, int toplevel,
664 - PyObject **freelist)
665 + freelist_t **freelist)
666 {
667 int level = 0;
668 int n = 0;
669 @@ -488,7 +462,7 @@
670
671 static char *
672 convertitem(PyObject *arg, const char **p_format, va_list *p_va, int flags,
673 - int *levels, char *msgbuf, size_t bufsize, PyObject **freelist)
674 + int *levels, char *msgbuf, size_t bufsize, freelist_t **freelist)
675 {
676 char *msg;
677 const char *format = *p_format;
678 @@ -569,7 +543,7 @@
679
680 static char *
681 convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
682 - char *msgbuf, size_t bufsize, PyObject **freelist)
683 + char *msgbuf, size_t bufsize, freelist_t **freelist)
684 {
685 /* For # codes */
686 #define FETCH_SIZE int *q=NULL;Py_ssize_t *q2=NULL;\
687 @@ -1534,7 +1508,8 @@
688 const char *fname, *msg, *custom_msg, *keyword;
689 int min = INT_MAX;
690 int i, len, nargs, nkeywords;
691 - PyObject *freelist = NULL, *current_arg;
692 + freelist_t *freelist = NULL;
693 + PyObject *current_arg;
694
695 assert(args != NULL && PyTuple_Check(args));
696 assert(keywords == NULL || PyDict_Check(keywords));
697 diff -r c7dff5469611f03946466caed17c567c4ea5d8d0 -r c26dc70ee34018efeec8b789d40ec78478304bc0 pypy/module/cpyext/test/test_getargs.py
698 --- a/pypy/module/cpyext/test/test_getargs.py Wed Jun 13 13:19:05 2012 +0200
699 +++ b/pypy/module/cpyext/test/test_getargs.py Wed Jun 13 15:48:19 2012 +0200
700 @@ -144,6 +144,31 @@
701 assert 'foo\0bar\0baz' == pybuffer(buffer('foo\0bar\0baz'))
702
703
704 + def test_pyarg_parse_string_fails(self):
705 + """
706 + Test the failing case of PyArg_ParseTuple(): it must not keep
707 + a reference on the PyObject passed in.
708 + """
709 + pybuffer = self.import_parser(
710 + '''
711 + Py_buffer buf1, buf2, buf3;
712 + PyObject *result;
713 + if (!PyArg_ParseTuple(args, "s*s*s*", &buf1, &buf2, &buf3)) {
714 + return NULL;
715 + }
716 + Py_FatalError("should not get there");
717 + return NULL;
718 + ''')
719 + freed = []
720 + class freestring(str):
721 + def __del__(self):
722 + freed.append('x')
723 + raises(TypeError, pybuffer,
724 + freestring("string"), freestring("other string"), 42)
725 + import gc; gc.collect()
726 + assert freed == ['x', 'x']
727 +
728 +
729 def test_pyarg_parse_charbuf_and_length(self):
730 """
731 The `t#` format specifier can be used to parse a read-only 8-bit
732
733
734
735 1.1 dev-python/pypy-bin/files/1.9-no-bytecode-4151f9c406b6.patch
736
737 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-no-bytecode-4151f9c406b6.patch?rev=1.1&view=markup
738 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-no-bytecode-4151f9c406b6.patch?rev=1.1&content-type=text/plain
739
740 Index: 1.9-no-bytecode-4151f9c406b6.patch
741 ===================================================================
742 # HG changeset patch
743 # User Armin Rigo <arigo@×××××.org>
744 # Date 1339165065 -7200
745 # Node ID 4151f9c406b62f6c4a1fdd669389eb46eb90f9cb
746 # Parent 68f8d7152a45fa7856a2a013799874614fcd9c33
747 issue1043 3rd issue fixed
748
749 diff -r 68f8d7152a45fa7856a2a013799874614fcd9c33 -r 4151f9c406b62f6c4a1fdd669389eb46eb90f9cb pypy/translator/goal/app_main.py
750 --- a/pypy/translator/goal/app_main.py Fri Jun 08 16:06:33 2012 +0200
751 +++ b/pypy/translator/goal/app_main.py Fri Jun 08 16:17:45 2012 +0200
752 @@ -457,13 +457,13 @@
753
754 if PYTHON26 and not options["ignore_environment"]:
755 if os.getenv('PYTHONNOUSERSITE'):
756 - options["no_user_site"] = True
757 + options["no_user_site"] = 1
758 if os.getenv('PYTHONDONTWRITEBYTECODE'):
759 - options["dont_write_bytecode"] = True
760 + options["dont_write_bytecode"] = 1
761
762 if (options["interactive"] or
763 (not options["ignore_environment"] and os.getenv('PYTHONINSPECT'))):
764 - options["inspect"] = True
765 + options["inspect"] = 1
766
767 if PYTHON26 and we_are_translated():
768 flags = [options[flag] for flag in sys_flags]
769
770
771
772 1.1 dev-python/pypy-bin/files/1.9-distutils-fix_handling_of_executables_and_flags.patch
773
774 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-distutils-fix_handling_of_executables_and_flags.patch?rev=1.1&view=markup
775 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-distutils-fix_handling_of_executables_and_flags.patch?rev=1.1&content-type=text/plain
776
777 Index: 1.9-distutils-fix_handling_of_executables_and_flags.patch
778 ===================================================================
779 --- lib-python/2.7/distutils/ccompiler.py
780 +++ lib-python/2.7/distutils/ccompiler.py
781 @@ -27,10 +27,16 @@
782 varies across Unices and is stored in Python's Makefile.
783 """
784 if compiler.compiler_type == "unix":
785 - (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \
786 - _sysconfig.get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
787 - 'CCSHARED', 'LDSHARED', 'SO', 'AR',
788 - 'ARFLAGS')
789 + cc = ' '.join(compiler.compiler)
790 + cxx = ' '.join(compiler.compiler_cxx)
791 + ldshared = ' '.join(compiler.linker_so)
792 + ldcxxshared = ' '.join(compiler.linker_so_cxx)
793 + ar = compiler.archiver[0]
794 +
795 + cflags = ''
796 + cxxflags = ''
797 + ccshared = '-fPIC'
798 + ar_flags = compiler.archiver[1]
799
800 if 'CC' in os.environ:
801 cc = os.environ['CC']
802 @@ -38,19 +44,27 @@
803 cxx = os.environ['CXX']
804 if 'LDSHARED' in os.environ:
805 ldshared = os.environ['LDSHARED']
806 + if 'LDCXXSHARED' in os.environ:
807 + ldcxxshared = os.environ['LDCXXSHARED']
808 if 'CPP' in os.environ:
809 cpp = os.environ['CPP']
810 else:
811 cpp = cc + " -E" # not always
812 if 'LDFLAGS' in os.environ:
813 ldshared = ldshared + ' ' + os.environ['LDFLAGS']
814 + ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
815 if 'CFLAGS' in os.environ:
816 - cflags = opt + ' ' + os.environ['CFLAGS']
817 + cflags = os.environ['CFLAGS']
818 ldshared = ldshared + ' ' + os.environ['CFLAGS']
819 + if 'CXXFLAGS' in os.environ:
820 + cxxflags = os.environ['CXXFLAGS']
821 + ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
822 if 'CPPFLAGS' in os.environ:
823 cpp = cpp + ' ' + os.environ['CPPFLAGS']
824 cflags = cflags + ' ' + os.environ['CPPFLAGS']
825 + cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
826 ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
827 + ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
828 if 'AR' in os.environ:
829 ar = os.environ['AR']
830 if 'ARFLAGS' in os.environ:
831 @@ -59,17 +73,19 @@
832 archiver = ar + ' ' + ar_flags
833
834 cc_cmd = cc + ' ' + cflags
835 + cxx_cmd = cxx + ' ' + cxxflags
836 compiler.set_executables(
837 preprocessor=cpp,
838 compiler=cc_cmd,
839 compiler_so=cc_cmd + ' ' + ccshared,
840 - compiler_cxx=cxx,
841 + compiler_cxx=cxx_cmd,
842 + compiler_so_cxx=cxx_cmd + ' ' + ccshared,
843 linker_so=ldshared,
844 linker_exe=cc,
845 + linker_so_cxx=ldcxxshared,
846 + linker_exe_cxx=cxx,
847 archiver=archiver)
848
849 - compiler.shared_lib_extension = so_ext
850 -
851 class CCompiler:
852 """Abstract base class to define the interface that must be implemented
853 by real compiler classes. Also has some utility methods used by
854 --- lib-python/2.7/distutils/cygwinccompiler.py
855 +++ lib-python/2.7/distutils/cygwinccompiler.py
856 @@ -135,9 +135,13 @@
857 self.set_executables(compiler='gcc -mcygwin -O -Wall',
858 compiler_so='gcc -mcygwin -mdll -O -Wall',
859 compiler_cxx='g++ -mcygwin -O -Wall',
860 + compiler_so_cxx='g++ -mcygwin -mdll -O -Wall',
861 linker_exe='gcc -mcygwin',
862 linker_so=('%s -mcygwin %s' %
863 - (self.linker_dll, shared_option)))
864 + (self.linker_dll, shared_option)),
865 + linker_exe_cxx='g++ -mcygwin',
866 + linker_so_cxx=('%s -mcygwin %s' %
867 + (self.linker_dll, shared_option)))
868
869 # cygwin and mingw32 need different sets of libraries
870 if self.gcc_version == "2.91.57":
871 @@ -163,8 +167,12 @@
872 raise CompileError, msg
873 else: # for other files use the C-compiler
874 try:
875 - self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
876 - extra_postargs)
877 + if self.detect_language(src) == 'c++':
878 + self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
879 + extra_postargs)
880 + else:
881 + self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
882 + extra_postargs)
883 except DistutilsExecError, msg:
884 raise CompileError, msg
885
886 @@ -325,10 +333,15 @@
887 self.set_executables(compiler='gcc -mno-cygwin -O -Wall',
888 compiler_so='gcc -mno-cygwin -mdll -O -Wall',
889 compiler_cxx='g++ -mno-cygwin -O -Wall',
890 + compiler_so_cxx='g++ -mno-cygwin -mdll -O -Wall',
891 linker_exe='gcc -mno-cygwin',
892 linker_so='%s -mno-cygwin %s %s'
893 % (self.linker_dll, shared_option,
894 - entry_point))
895 + entry_point),
896 + linker_exe_cxx='g++ -mno-cygwin',
897 + linker_so_cxx='%s -mno-cygwin %s %s'
898 + % (self.linker_dll, shared_option,
899 + entry_point))
900 # Maybe we should also append -mthreads, but then the finished
901 # dlls need another dll (mingwm10.dll see Mingw32 docs)
902 # (-mthreads: Support thread-safe exception handling on `Mingw32')
903 --- lib-python/2.7/distutils/emxccompiler.py
904 +++ lib-python/2.7/distutils/emxccompiler.py
905 @@ -65,8 +65,12 @@
906 # XXX optimization, warnings etc. should be customizable.
907 self.set_executables(compiler='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
908 compiler_so='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
909 + compiler_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
910 + compiler_so_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
911 linker_exe='gcc -Zomf -Zmt -Zcrtdll',
912 - linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll')
913 + linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll',
914 + linker_exe_cxx='g++ -Zomf -Zmt -Zcrtdll',
915 + linker_so_cxx='g++ -Zomf -Zmt -Zcrtdll -Zdll')
916
917 # want the gcc library statically linked (so that we don't have
918 # to distribute a version dependent on the compiler we have)
919 @@ -83,8 +87,12 @@
920 raise CompileError, msg
921 else: # for other files use the C-compiler
922 try:
923 - self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
924 - extra_postargs)
925 + if self.detect_language(src) == 'c++':
926 + self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
927 + extra_postargs)
928 + else:
929 + self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
930 + extra_postargs)
931 except DistutilsExecError, msg:
932 raise CompileError, msg
933
934 --- lib-python/2.7/distutils/sysconfig_cpython.py
935 +++ lib-python/2.7/distutils/sysconfig_cpython.py
936 @@ -149,9 +149,12 @@
937 varies across Unices and is stored in Python's Makefile.
938 """
939 if compiler.compiler_type == "unix":
940 - (cc, cxx, opt, cflags, ccshared, ldshared, so_ext) = \
941 - get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
942 - 'CCSHARED', 'LDSHARED', 'SO')
943 + (cc, cxx, ccshared, ldshared, ldcxxshared, so_ext) = \
944 + get_config_vars('CC', 'CXX', 'CCSHARED', 'LDSHARED',
945 + 'LDCXXSHARED', 'SO')
946 +
947 + cflags = ''
948 + cxxflags = ''
949
950 if 'CC' in os.environ:
951 cc = os.environ['CC']
952 @@ -159,28 +162,40 @@
953 cxx = os.environ['CXX']
954 if 'LDSHARED' in os.environ:
955 ldshared = os.environ['LDSHARED']
956 + if 'LDCXXSHARED' in os.environ:
957 + ldcxxshared = os.environ['LDCXXSHARED']
958 if 'CPP' in os.environ:
959 cpp = os.environ['CPP']
960 else:
961 cpp = cc + " -E" # not always
962 if 'LDFLAGS' in os.environ:
963 ldshared = ldshared + ' ' + os.environ['LDFLAGS']
964 + ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
965 if 'CFLAGS' in os.environ:
966 - cflags = opt + ' ' + os.environ['CFLAGS']
967 + cflags = os.environ['CFLAGS']
968 ldshared = ldshared + ' ' + os.environ['CFLAGS']
969 + if 'CXXFLAGS' in os.environ:
970 + cxxflags = os.environ['CXXFLAGS']
971 + ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
972 if 'CPPFLAGS' in os.environ:
973 cpp = cpp + ' ' + os.environ['CPPFLAGS']
974 cflags = cflags + ' ' + os.environ['CPPFLAGS']
975 + cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
976 ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
977 + ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
978
979 cc_cmd = cc + ' ' + cflags
980 + cxx_cmd = cxx + ' ' + cxxflags
981 compiler.set_executables(
982 preprocessor=cpp,
983 compiler=cc_cmd,
984 compiler_so=cc_cmd + ' ' + ccshared,
985 - compiler_cxx=cxx,
986 + compiler_cxx=cxx_cmd,
987 + compiler_so_cxx=cxx_cmd + ' ' + ccshared,
988 linker_so=ldshared,
989 - linker_exe=cc)
990 + linker_exe=cc,
991 + linker_so_cxx=ldcxxshared,
992 + linker_exe_cxx=cxx)
993
994 compiler.shared_lib_extension = so_ext
995
996 @@ -506,7 +521,7 @@
997 for key in ('LDFLAGS', 'BASECFLAGS', 'LDSHARED',
998 # a number of derived variables. These need to be
999 # patched up as well.
1000 - 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
1001 + 'CFLAGS', 'CXXFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
1002 flags = _config_vars[key]
1003 flags = re.sub('-arch\s+\w+\s', ' ', flags)
1004 flags = re.sub('-isysroot [^ \t]*', ' ', flags)
1005 @@ -525,7 +540,7 @@
1006 for key in ('LDFLAGS', 'BASECFLAGS', 'LDSHARED',
1007 # a number of derived variables. These need to be
1008 # patched up as well.
1009 - 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
1010 + 'CFLAGS', 'CXXFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
1011
1012 flags = _config_vars[key]
1013 flags = re.sub('-arch\s+\w+\s', ' ', flags)
1014 @@ -549,7 +564,7 @@
1015 for key in ('LDFLAGS', 'BASECFLAGS', 'LDSHARED',
1016 # a number of derived variables. These need to be
1017 # patched up as well.
1018 - 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
1019 + 'CFLAGS', 'CXXFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
1020
1021 flags = _config_vars[key]
1022 flags = re.sub('-isysroot\s+\S+(\s|$)', ' ', flags)
1023 --- lib-python/2.7/distutils/sysconfig_pypy.py
1024 +++ lib-python/2.7/distutils/sysconfig_pypy.py
1025 @@ -114,13 +114,56 @@
1026 optional C speedup components.
1027 """
1028 if compiler.compiler_type == "unix":
1029 - compiler.compiler_so.extend(['-fPIC', '-Wimplicit'])
1030 + cc = ' '.join(compiler.compiler)
1031 + cxx = ' '.join(compiler.compiler_cxx)
1032 + ldshared = ' '.join(compiler.linker_so)
1033 + ldcxxshared = ' '.join(compiler.linker_so_cxx)
1034 +
1035 + cflags = ''
1036 + cxxflags = ''
1037 + ccshared = '-fPIC'
1038 +
1039 + if 'CC' in os.environ:
1040 + cc = os.environ['CC']
1041 + if 'CXX' in os.environ:
1042 + cxx = os.environ['CXX']
1043 + if 'LDSHARED' in os.environ:
1044 + ldshared = os.environ['LDSHARED']
1045 + if 'LDCXXSHARED' in os.environ:
1046 + ldcxxshared = os.environ['LDCXXSHARED']
1047 + if 'CPP' in os.environ:
1048 + cpp = os.environ['CPP']
1049 + else:
1050 + cpp = cc + " -E" # not always
1051 + if 'LDFLAGS' in os.environ:
1052 + ldshared = ldshared + ' ' + os.environ['LDFLAGS']
1053 + ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
1054 + if 'CFLAGS' in os.environ:
1055 + cflags = os.environ['CFLAGS']
1056 + ldshared = ldshared + ' ' + os.environ['CFLAGS']
1057 + if 'CXXFLAGS' in os.environ:
1058 + cxxflags = os.environ['CXXFLAGS']
1059 + ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
1060 + if 'CPPFLAGS' in os.environ:
1061 + cpp = cpp + ' ' + os.environ['CPPFLAGS']
1062 + cflags = cflags + ' ' + os.environ['CPPFLAGS']
1063 + cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
1064 + ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
1065 + ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
1066 +
1067 + cc_cmd = cc + ' ' + cflags
1068 + cxx_cmd = cxx + ' ' + cxxflags
1069 + compiler.set_executables(
1070 + preprocessor=cpp,
1071 + compiler=cc_cmd,
1072 + compiler_so=cc_cmd + ' ' + ccshared,
1073 + compiler_cxx=cxx_cmd,
1074 + compiler_so_cxx=cxx_cmd + ' ' + ccshared,
1075 + linker_so=ldshared,
1076 + linker_exe=cc,
1077 + linker_so_cxx=ldcxxshared,
1078 + linker_exe_cxx=cxx)
1079 compiler.shared_lib_extension = get_config_var('SO')
1080 - if "CFLAGS" in os.environ:
1081 - cflags = os.environ["CFLAGS"]
1082 - compiler.compiler.append(cflags)
1083 - compiler.compiler_so.append(cflags)
1084 - compiler.linker_so.append(cflags)
1085
1086
1087 from sysconfig_cpython import (
1088 --- lib-python/2.7/distutils/unixccompiler.py
1089 +++ lib-python/2.7/distutils/unixccompiler.py
1090 @@ -114,14 +114,17 @@
1091 # are pretty generic; they will probably have to be set by an outsider
1092 # (eg. using information discovered by the sysconfig about building
1093 # Python extensions).
1094 - executables = {'preprocessor' : None,
1095 - 'compiler' : ["cc"],
1096 - 'compiler_so' : ["cc"],
1097 - 'compiler_cxx' : ["cc"],
1098 - 'linker_so' : ["cc", "-shared"],
1099 - 'linker_exe' : ["cc"],
1100 - 'archiver' : ["ar", "-cr"],
1101 - 'ranlib' : None,
1102 + executables = {'preprocessor' : None,
1103 + 'compiler' : ["cc"],
1104 + 'compiler_so' : ["cc"],
1105 + 'compiler_cxx' : ["c++"],
1106 + 'compiler_so_cxx' : ["c++"],
1107 + 'linker_so' : ["cc", "-shared"],
1108 + 'linker_exe' : ["cc"],
1109 + 'linker_so_cxx' : ["c++", "-shared"],
1110 + 'linker_exe_cxx' : ["c++"],
1111 + 'archiver' : ["ar", "-cr"],
1112 + 'ranlib' : None,
1113 }
1114
1115 if sys.platform[:6] == "darwin":
1116 @@ -186,11 +189,18 @@
1117
1118 def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
1119 compiler_so = self.compiler_so
1120 + compiler_so_cxx = self.compiler_so_cxx
1121 if sys.platform == 'darwin':
1122 compiler_so = _darwin_compiler_fixup(compiler_so, cc_args + extra_postargs)
1123 + compiler_so_cxx = _darwin_compiler_fixup(compiler_so_cxx, cc_args +
1124 + extra_postargs)
1125 try:
1126 - self.spawn(compiler_so + cc_args + [src, '-o', obj] +
1127 - extra_postargs)
1128 + if self.detect_language(src) == 'c++':
1129 + self.spawn(compiler_so_cxx + cc_args + [src, '-o', obj] +
1130 + extra_postargs)
1131 + else:
1132 + self.spawn(compiler_so + cc_args + [src, '-o', obj] +
1133 + extra_postargs)
1134 except DistutilsExecError, msg:
1135 raise CompileError, msg
1136
1137 @@ -247,23 +257,16 @@
1138 ld_args.extend(extra_postargs)
1139 self.mkpath(os.path.dirname(output_filename))
1140 try:
1141 - if target_desc == CCompiler.EXECUTABLE:
1142 - linker = self.linker_exe[:]
1143 + if target_lang == "c++":
1144 + if target_desc == CCompiler.EXECUTABLE:
1145 + linker = self.linker_exe_cxx[:]
1146 + else:
1147 + linker = self.linker_so_cxx[:]
1148 else:
1149 - linker = self.linker_so[:]
1150 - if target_lang == "c++" and self.compiler_cxx:
1151 - # skip over environment variable settings if /usr/bin/env
1152 - # is used to set up the linker's environment.
1153 - # This is needed on OSX. Note: this assumes that the
1154 - # normal and C++ compiler have the same environment
1155 - # settings.
1156 - i = 0
1157 - if os.path.basename(linker[0]) == "env":
1158 - i = 1
1159 - while '=' in linker[i]:
1160 - i = i + 1
1161 -
1162 - linker[i] = self.compiler_cxx[i]
1163 + if target_desc == CCompiler.EXECUTABLE:
1164 + linker = self.linker_exe[:]
1165 + else:
1166 + linker = self.linker_so[:]
1167
1168 if sys.platform == 'darwin':
1169 linker = _darwin_compiler_fixup(linker, ld_args)
1170
1171
1172
1173 1.1 dev-python/pypy-bin/files/1.9-ssl-errors-25d3418150d2.patch
1174
1175 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-ssl-errors-25d3418150d2.patch?rev=1.1&view=markup
1176 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-ssl-errors-25d3418150d2.patch?rev=1.1&content-type=text/plain
1177
1178 Index: 1.9-ssl-errors-25d3418150d2.patch
1179 ===================================================================
1180 # HG changeset patch
1181 # User Amaury Forgeot d'Arc <amauryfa@×××××.com>
1182 # Date 1339449304 -7200
1183 # Node ID 25d3418150d2e2820913043432f568e31bf3a19a
1184 # Parent 33c305197a3d05217be023fa39a692ad89802317
1185 issue1169: _ssl errors outside any SSL context should use ERR_peek_last_error()
1186
1187 diff -r 33c305197a3d05217be023fa39a692ad89802317 -r 25d3418150d2e2820913043432f568e31bf3a19a pypy/module/_ssl/interp_ssl.py
1188 --- a/pypy/module/_ssl/interp_ssl.py Mon Jun 11 23:01:31 2012 +0200
1189 +++ b/pypy/module/_ssl/interp_ssl.py Mon Jun 11 23:15:04 2012 +0200
1190 @@ -789,7 +789,11 @@
1191 def _ssl_seterror(space, ss, ret):
1192 assert ret <= 0
1193
1194 - if ss and ss.ssl:
1195 + if ss is None:
1196 + errval = libssl_ERR_peek_last_error()
1197 + errstr = rffi.charp2str(libssl_ERR_error_string(errval, None))
1198 + return ssl_error(space, errstr, errval)
1199 + elif ss.ssl:
1200 err = libssl_SSL_get_error(ss.ssl, ret)
1201 else:
1202 err = SSL_ERROR_SSL
1203 diff -r 33c305197a3d05217be023fa39a692ad89802317 -r 25d3418150d2e2820913043432f568e31bf3a19a pypy/rlib/ropenssl.py
1204 --- a/pypy/rlib/ropenssl.py Mon Jun 11 23:01:31 2012 +0200
1205 +++ b/pypy/rlib/ropenssl.py Mon Jun 11 23:15:04 2012 +0200
1206 @@ -259,6 +259,7 @@
1207 ssl_external('SSL_CIPHER_get_bits', [SSL_CIPHER, rffi.INTP], rffi.INT)
1208
1209 ssl_external('ERR_get_error', [], rffi.INT)
1210 +ssl_external('ERR_peek_last_error', [], rffi.INT)
1211 ssl_external('ERR_error_string', [rffi.ULONG, rffi.CCHARP], rffi.CCHARP)
1212
1213 ssl_external('SSL_free', [SSL], lltype.Void)
1214
1215
1216
1217 1.1 dev-python/pypy-bin/files/1.9-no-static-hack.patch
1218
1219 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-no-static-hack.patch?rev=1.1&view=markup
1220 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-no-static-hack.patch?rev=1.1&content-type=text/plain
1221
1222 Index: 1.9-no-static-hack.patch
1223 ===================================================================
1224 Remove logic that links to libssl and libcrypto statically if
1225 possible. Just always link dynamically: Gentoo is expected to have
1226 sane dynamic libraries for us to use, and our users are not expected
1227 to copy their pypy binary to a system with an incompatible
1228 libssl/libcrypto and expect it to work.
1229
1230 Patch contributed by XU Benda <heroxbd@g.o>.
1231
1232 --- pypy/rlib/ropenssl.py 2012-06-07 21:24:48.000000000 +0900
1233 +++ pypy/rlib/ropenssl.py.new 2012-06-10 17:28:29.000000000 +0900
1234 @@ -19,18 +19,8 @@ if sys.platform == 'win32' and platform.
1235 # so that openssl/ssl.h can repair this nonsense.
1236 'wincrypt.h']
1237 else:
1238 - libraries = ['z']
1239 + libraries = ['z', 'ssl', 'crypto']
1240 includes = []
1241 - if (sys.platform.startswith('linux') and
1242 - os.path.exists('/usr/lib/libssl.a') and
1243 - os.path.exists('/usr/lib/libcrypto.a')):
1244 - # use static linking to avoid the infinite
1245 - # amount of troubles due to symbol versions
1246 - # and 0.9.8/1.0.0
1247 - link_files += ['/usr/lib/libssl.a', '/usr/lib/libcrypto.a']
1248 - testonly_libraries += ['ssl', 'crypto']
1249 - else:
1250 - libraries += ['ssl', 'crypto']
1251
1252 includes += [
1253 'openssl/ssl.h',
1254
1255
1256
1257 1.1 dev-python/pypy-bin/files/1.9-get_python_lib_standard_lib-04ea518e5b71.patch
1258
1259 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-get_python_lib_standard_lib-04ea518e5b71.patch?rev=1.1&view=markup
1260 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-get_python_lib_standard_lib-04ea518e5b71.patch?rev=1.1&content-type=text/plain
1261
1262 Index: 1.9-get_python_lib_standard_lib-04ea518e5b71.patch
1263 ===================================================================
1264 changeset: 55566:04ea518e5b71
1265 parent: 55554:fa1ecb3a52df
1266 user: Armin Rigo <arigo@×××××.org>
1267 date: Mon Jun 11 10:28:26 2012 +0200
1268 summary: issue1164: get_python_lib(standard_lib=1) should probably just
1269
1270 diff -r fa1ecb3a52df -r 04ea518e5b71 lib-python/2.7/distutils/sysconfig_pypy.py
1271 --- a/lib-python/2.7/distutils/sysconfig_pypy.py Sun Jun 10 23:49:16 2012 +0300
1272 +++ b/lib-python/2.7/distutils/sysconfig_pypy.py Mon Jun 11 10:28:26 2012 +0200
1273 @@ -39,11 +39,10 @@
1274 If 'prefix' is supplied, use it instead of sys.prefix or
1275 sys.exec_prefix -- i.e., ignore 'plat_specific'.
1276 """
1277 - if standard_lib:
1278 - raise DistutilsPlatformError(
1279 - "calls to get_python_lib(standard_lib=1) cannot succeed")
1280 if prefix is None:
1281 prefix = PREFIX
1282 + if standard_lib:
1283 + return os.path.join(prefix, "lib-python", get_python_version())
1284 return os.path.join(prefix, 'site-packages')
1285
1286
1287
1288
1289
1290
1291 1.1 dev-python/pypy-bin/files/1.9-more-ignored-ops-146ddf82a279.patch
1292
1293 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-more-ignored-ops-146ddf82a279.patch?rev=1.1&view=markup
1294 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-more-ignored-ops-146ddf82a279.patch?rev=1.1&content-type=text/plain
1295
1296 Index: 1.9-more-ignored-ops-146ddf82a279.patch
1297 ===================================================================
1298 changeset: 55567:146ddf82a279
1299 user: Armin Rigo <arigo@×××××.org>
1300 date: Mon Jun 11 10:33:19 2012 +0200
1301 summary: More ignored ops
1302
1303 diff -r 04ea518e5b71 -r 146ddf82a279 pypy/translator/c/gcc/trackgcroot.py
1304 --- a/pypy/translator/c/gcc/trackgcroot.py Mon Jun 11 10:28:26 2012 +0200
1305 +++ b/pypy/translator/c/gcc/trackgcroot.py Mon Jun 11 10:33:19 2012 +0200
1306 @@ -476,13 +476,13 @@
1307 # floating-point operations cannot produce GC pointers
1308 'f',
1309 'cvt', 'ucomi', 'comi', 'subs', 'subp' , 'adds', 'addp', 'xorp',
1310 - 'movap', 'movd', 'movlp', 'sqrtsd', 'movhpd',
1311 + 'movap', 'movd', 'movlp', 'sqrt', 'rsqrt', 'movhpd',
1312 'mins', 'minp', 'maxs', 'maxp', 'unpck', 'pxor', 'por', # sse2
1313 'shufps', 'shufpd',
1314 # arithmetic operations should not produce GC pointers
1315 'inc', 'dec', 'not', 'neg', 'or', 'and', 'sbb', 'adc',
1316 'shl', 'shr', 'sal', 'sar', 'rol', 'ror', 'mul', 'imul', 'div', 'idiv',
1317 - 'bswap', 'bt', 'rdtsc',
1318 + 'bswap', 'bt', 'rdtsc', 'rounds',
1319 'pabs', 'pack', 'padd', 'palign', 'pand', 'pavg', 'pcmp', 'pextr',
1320 'phadd', 'phsub', 'pinsr', 'pmadd', 'pmax', 'pmin', 'pmovmsk',
1321 'pmul', 'por', 'psadb', 'pshuf', 'psign', 'psll', 'psra', 'psrl',
1322
1323
1324
1325
1326 1.1 dev-python/pypy-bin/files/1.9-ssl-threads-1-34b3b5aac082.patch
1327
1328 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-ssl-threads-1-34b3b5aac082.patch?rev=1.1&view=markup
1329 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-ssl-threads-1-34b3b5aac082.patch?rev=1.1&content-type=text/plain
1330
1331 Index: 1.9-ssl-threads-1-34b3b5aac082.patch
1332 ===================================================================
1333 changeset: 55575:34b3b5aac082
1334 parent: 55569:fa8262a5746a
1335 user: Armin Rigo <arigo@×××××.org>
1336 date: Mon Jun 11 14:38:35 2012 +0200
1337 summary: Move the callback logic to C code instead of using RPython code
1338
1339 diff -r fa8262a5746a -r 34b3b5aac082 pypy/module/_ssl/__init__.py
1340 --- a/pypy/module/_ssl/__init__.py Mon Jun 11 11:04:53 2012 +0200
1341 +++ b/pypy/module/_ssl/__init__.py Mon Jun 11 14:38:35 2012 +0200
1342 @@ -31,5 +31,6 @@
1343 def startup(self, space):
1344 from pypy.rlib.ropenssl import init_ssl
1345 init_ssl()
1346 - from pypy.module._ssl.interp_ssl import setup_ssl_threads
1347 - setup_ssl_threads()
1348 + if space.config.objspace.usemodules.thread:
1349 + from pypy.module._ssl.thread_lock import setup_ssl_threads
1350 + setup_ssl_threads()
1351 diff -r fa8262a5746a -r 34b3b5aac082 pypy/module/_ssl/interp_ssl.py
1352 --- a/pypy/module/_ssl/interp_ssl.py Mon Jun 11 11:04:53 2012 +0200
1353 +++ b/pypy/module/_ssl/interp_ssl.py Mon Jun 11 14:38:35 2012 +0200
1354 @@ -880,38 +880,3 @@
1355 libssl_X509_free(x)
1356 finally:
1357 libssl_BIO_free(cert)
1358 -
1359 -# this function is needed to perform locking on shared data
1360 -# structures. (Note that OpenSSL uses a number of global data
1361 -# structures that will be implicitly shared whenever multiple threads
1362 -# use OpenSSL.) Multi-threaded applications will crash at random if
1363 -# it is not set.
1364 -#
1365 -# locking_function() must be able to handle up to CRYPTO_num_locks()
1366 -# different mutex locks. It sets the n-th lock if mode & CRYPTO_LOCK, and
1367 -# releases it otherwise.
1368 -#
1369 -# filename and line are the file number of the function setting the
1370 -# lock. They can be useful for debugging.
1371 -_ssl_locks = []
1372 -
1373 -def _ssl_thread_locking_function(mode, n, filename, line):
1374 - n = intmask(n)
1375 - if n < 0 or n >= len(_ssl_locks):
1376 - return
1377 -
1378 - if intmask(mode) & CRYPTO_LOCK:
1379 - _ssl_locks[n].acquire(True)
1380 - else:
1381 - _ssl_locks[n].release()
1382 -
1383 -def _ssl_thread_id_function():
1384 - from pypy.module.thread import ll_thread
1385 - return rffi.cast(rffi.LONG, ll_thread.get_ident())
1386 -
1387 -def setup_ssl_threads():
1388 - from pypy.module.thread import ll_thread
1389 - for i in range(libssl_CRYPTO_num_locks()):
1390 - _ssl_locks.append(ll_thread.allocate_lock())
1391 - libssl_CRYPTO_set_locking_callback(_ssl_thread_locking_function)
1392 - libssl_CRYPTO_set_id_callback(_ssl_thread_id_function)
1393 diff -r fa8262a5746a -r 34b3b5aac082 pypy/module/_ssl/thread_lock.py
1394 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1395 +++ b/pypy/module/_ssl/thread_lock.py Mon Jun 11 14:38:35 2012 +0200
1396 @@ -0,0 +1,78 @@
1397 +from pypy.rlib.ropenssl import *
1398 +from pypy.rpython.lltypesystem import lltype, rffi
1399 +from pypy.translator.tool.cbuild import ExternalCompilationInfo
1400 +
1401 +# CRYPTO_set_locking_callback:
1402 +#
1403 +# this function is needed to perform locking on shared data
1404 +# structures. (Note that OpenSSL uses a number of global data
1405 +# structures that will be implicitly shared whenever multiple threads
1406 +# use OpenSSL.) Multi-threaded applications will crash at random if
1407 +# it is not set.
1408 +#
1409 +# locking_function() must be able to handle up to CRYPTO_num_locks()
1410 +# different mutex locks. It sets the n-th lock if mode & CRYPTO_LOCK, and
1411 +# releases it otherwise.
1412 +#
1413 +# filename and line are the file number of the function setting the
1414 +# lock. They can be useful for debugging.
1415 +
1416 +
1417 +# This logic is moved to C code so that the callbacks can be invoked
1418 +# without caring about the GIL.
1419 +
1420 +separate_module_source = """
1421 +
1422 +#include <openssl/crypto.h>
1423 +
1424 +static unsigned int _ssl_locks_count = 0;
1425 +static struct RPyOpaque_ThreadLock *_ssl_locks;
1426 +
1427 +static unsigned long _ssl_thread_id_function(void) {
1428 + return RPyThreadGetIdent();
1429 +}
1430 +
1431 +static void _ssl_thread_locking_function(int mode, int n, const char *file,
1432 + int line) {
1433 + if ((_ssl_locks == NULL) ||
1434 + (n < 0) || ((unsigned)n >= _ssl_locks_count))
1435 + return;
1436 +
1437 + if (mode & CRYPTO_LOCK) {
1438 + RPyThreadAcquireLock(_ssl_locks[n], 1);
1439 + } else {
1440 + RPyThreadReleaseLock(_ssl_locks[n]);
1441 + }
1442 +}
1443 +
1444 +int _PyPy_SSL_SetupThreads(void)
1445 +{
1446 + unsigned int i;
1447 + _ssl_locks_count = CRYPTO_num_locks();
1448 + _ssl_locks = calloc(_ssl_locks_count, sizeof(struct RPyOpaque_ThreadLock));
1449 + if (_ssl_locks == NULL)
1450 + return 0;
1451 + for (i=0; i<_ssl_locks_count; i++) {
1452 + if (RPyThreadLockInit(_ssl_locks + i) == 0)
1453 + return 0;
1454 + }
1455 + CRYPTO_set_locking_callback(_ssl_thread_locking_function);
1456 + CRYPTO_set_id_callback(_ssl_thread_id_function);
1457 + return 1;
1458 +}
1459 +"""
1460 +
1461 +
1462 +eci = ExternalCompilationInfo(
1463 + separate_module_sources=[separate_module_source],
1464 + export_symbols=['_PyPy_SSL_SetupThreads'],
1465 +)
1466 +
1467 +_PyPy_SSL_SetupThreads = rffi.llexternal('_PyPy_SSL_SetupThreads',
1468 + [], rffi.INT,
1469 + compilation_info=eci)
1470 +
1471 +def setup_ssl_threads():
1472 + result = _PyPy_SSL_SetupThreads()
1473 + if rffi.cast(lltype.Signed, result) == 0:
1474 + raise MemoryError
1475
1476
1477
1478
1479 1.1 dev-python/pypy-bin/files/1.9-signal-a33052b17f4e.patch
1480
1481 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-signal-a33052b17f4e.patch?rev=1.1&view=markup
1482 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pypy-bin/files/1.9-signal-a33052b17f4e.patch?rev=1.1&content-type=text/plain
1483
1484 Index: 1.9-signal-a33052b17f4e.patch
1485 ===================================================================
1486 changeset: 55595:a33052b17f4e
1487 parent: 55589:4f58f2db96c0
1488 user: Armin Rigo <arigo@×××××.org>
1489 date: Mon Jun 11 18:06:35 2012 +0200
1490 summary: issue1167: changed the test (according to py.test -A on Linux), and fix
1491
1492 diff -r 4f58f2db96c0 -r a33052b17f4e pypy/module/signal/interp_signal.py
1493 --- a/pypy/module/signal/interp_signal.py Mon Jun 11 17:05:01 2012 +0200
1494 +++ b/pypy/module/signal/interp_signal.py Mon Jun 11 18:06:35 2012 +0200
1495 @@ -227,7 +227,7 @@
1496 None -- if an unknown handler is in effect (XXX UNIMPLEMENTED)
1497 anything else -- the callable Python object used as a handler
1498 """
1499 - check_signum(space, signum)
1500 + check_signum_in_range(space, signum)
1501 action = space.check_signal_action
1502 if signum in action.handlers_w:
1503 return action.handlers_w[signum]
1504 @@ -253,12 +253,18 @@
1505 c_pause()
1506 return space.w_None
1507
1508 -def check_signum(space, signum):
1509 +def check_signum_exists(space, signum):
1510 if signum in signal_values:
1511 return
1512 raise OperationError(space.w_ValueError,
1513 space.wrap("invalid signal value"))
1514
1515 +def check_signum_in_range(space, signum):
1516 + if 1 <= signum < NSIG:
1517 + return
1518 + raise OperationError(space.w_ValueError,
1519 + space.wrap("signal number out of range"))
1520 +
1521
1522 @jit.dont_look_inside
1523 @unwrap_spec(signum=int)
1524 @@ -319,7 +325,7 @@
1525
1526 @unwrap_spec(signum=int, flag=int)
1527 def siginterrupt(space, signum, flag):
1528 - check_signum(space, signum)
1529 + check_signum_exists(space, signum)
1530 if rffi.cast(lltype.Signed, c_siginterrupt(signum, flag)) < 0:
1531 errno = rposix.get_errno()
1532 raise OperationError(space.w_RuntimeError, space.wrap(errno))
1533 diff -r 4f58f2db96c0 -r a33052b17f4e pypy/module/signal/test/test_signal.py
1534 --- a/pypy/module/signal/test/test_signal.py Mon Jun 11 17:05:01 2012 +0200
1535 +++ b/pypy/module/signal/test/test_signal.py Mon Jun 11 18:06:35 2012 +0200
1536 @@ -154,7 +154,12 @@
1537
1538 raises(ValueError, getsignal, 4444)
1539 raises(ValueError, signal, 4444, lambda *args: None)
1540 - raises(ValueError, signal, 42, lambda *args: None)
1541 + import sys
1542 + if sys.platform == 'win32':
1543 + raises(ValueError, signal, 42, lambda *args: None)
1544 + else:
1545 + signal(42, lambda *args: None)
1546 + signal(42, SIG_DFL)
1547
1548 def test_alarm(self):
1549 try: