summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorNeil Schemenauer <nas-github@arctrix.com>2017-06-16 02:12:46 (GMT)
committerMariatta <Mariatta@users.noreply.github.com>2017-06-16 02:12:46 (GMT)
commit9cead06076f890d4951b3ea2571408efe76f8b2c (patch)
tree9f4a816fa83e49a46f35c8c7d968dc8f329f8db2 /setup.py
parent6a90a124706b73824aebf5c2bd7b27daf82b2342 (diff)
downloadcpython-9cead06076f890d4951b3ea2571408efe76f8b2c.zip
cpython-9cead06076f890d4951b3ea2571408efe76f8b2c.tar.gz
cpython-9cead06076f890d4951b3ea2571408efe76f8b2c.tar.bz2
Check that Python is 64-bit before enabling BLAKE2_USE_SSE. (GH-1332) (GH-2042)
(cherry picked from commit 6c991bdee7ec4bedd8c1b8d3812dc884b654b57c)
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index f04bf22..fe47797 100644
--- a/setup.py
+++ b/setup.py
@@ -897,8 +897,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',