From: Stefano Rivera <stefanor@debian.org>
Date: Thu, 28 Dec 2017 21:05:26 +0100
Subject: rvmprof: Handle ProcessorAutodetectError

detect_cpu only knows about architectures supported by PyPy's JIT

Forwarded: https://bitbucket.org/pypy/pypy/commits/9472e9d10a8545f805ef3de7016d99ab23d7a3a8
Last-Update: 2017-12-28
---
 rpython/rlib/rvmprof/cintf.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/rpython/rlib/rvmprof/cintf.py b/rpython/rlib/rvmprof/cintf.py
index 051e558..f9fe63a 100644
--- a/rpython/rlib/rvmprof/cintf.py
+++ b/rpython/rlib/rvmprof/cintf.py
@@ -16,9 +16,12 @@ class VMProfPlatformUnsupported(Exception):
     pass
 
 # vmprof works only on x86 for now
-IS_SUPPORTED = detect_cpu.autodetect().startswith('x86')
-if sys.platform == 'win32':
-    IS_SUPPORTED = False
+IS_SUPPORTED = False
+if sys.platform in ('darwin', 'linux', 'linux2'):
+    try:
+        IS_SUPPORTED = detect_cpu.autodetect().startswith('x86')
+    except detect_cpu.ProcessorAutodetectError:
+        pass
 
 ROOT = py.path.local(rpythonroot).join('rpython', 'rlib', 'rvmprof')
 SRC = ROOT.join('src')
