diff options
author | Neil Schemenauer <nas-github@arctrix.com> | 2017-04-28 16:56:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-28 16:56:48 (GMT) |
commit | 6c991bdee7ec4bedd8c1b8d3812dc884b654b57c (patch) | |
tree | 0401cf8f86a82ee03d41f811942af51117cd9886 /setup.py | |
parent | d1a1def7bf221b04dcf3fc3a67aa19aa2f622f83 (diff) | |
download | cpython-6c991bdee7ec4bedd8c1b8d3812dc884b654b57c.zip cpython-6c991bdee7ec4bedd8c1b8d3812dc884b654b57c.tar.gz cpython-6c991bdee7ec4bedd8c1b8d3812dc884b654b57c.tar.bz2 |
Check that Python is 64-bit before enabling BLAKE2_USE_SSE. (#1332)
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -898,8 +898,11 @@ class PyBuildExt(build_ext): blake2_deps.append('hashlib.h') blake2_macros = [] - if not cross_compiling and os.uname().machine == "x86_64": - # Every x86_64 machine has at least SSE2. + if (not cross_compiling and + os.uname().machine == "x86_64" and + sys.maxsize > 2**32): + # Every x86_64 machine has at least SSE2. Check for sys.maxsize + # in case that kernel is 64-bit but userspace is 32-bit. blake2_macros.append(('BLAKE2_USE_SSE', '1')) exts.append( Extension('_blake2', |