From c67d2e9d8620829e8d3cd4aa3157590829e05b06 Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Thu, 27 Apr 2017 14:20:27 -0700 Subject: [PATCH] Check that Python is 64-bit before enabling BLAKE2_USE_SSE. --- setup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 3b3d097454211c..6a05643838bb4e 100644 --- a/setup.py +++ b/setup.py @@ -898,8 +898,11 @@ def detect_modules(self): 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',