Commit 14218b81 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 55611986
--- lib_pypy/_sysconfigdata.py.kirr 2020-04-07 05:59:04.000000000 +0300
+++ lib_pypy/_sysconfigdata.py 2020-07-15 20:34:43.000000000 +0300
@@ -39,15 +39,21 @@
build_time_vars["CXX"] = "g++ -pthread"
if sys.platform[:6] == "darwin":
- import platform
- if platform.machine() == 'i386':
- if platform.architecture()[0] == '32bit':
+ # don't import platform - it imports subprocess -> threading.
+ # gevent-based projects need to be first to import threading and
+ # monkey-patch as early as possible in the lifetime of their process.
+ # https://foss.heptapod.net/pypy/pypy/-/issues/3269
+ _, _, _, _, machine = os.uname()
+ import struct
+ wordsize = struct.calcsize('P') # void* : 4 on 32bit, 8 on 64bit
+ if machine == 'i386':
+ if wordsize == 4:
arch = 'i386'
else:
arch = 'x86_64'
else:
# just a guess
- arch = platform.machine()
+ arch = machine
build_time_vars['LDSHARED'] += ' -undefined dynamic_lookup'
build_time_vars['CC'] += ' -arch %s' % (arch,)
if "CXX" in build_time_vars:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment