[pypy-commit] pypy default: this method of determining the CPU is broken in presence of cross-translations (like we do e.g. on ARM). Try to use detect_cpu, which seems to have logic to handle that

antocuni pypy.commits at gmail.com
Wed Dec 20 05:16:27 EST 2017


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: 
Changeset: r93508:b1b0f51304ce
Date: 2017-12-20 11:15 +0100
http://bitbucket.org/pypy/pypy/changeset/b1b0f51304ce/

Log:	this method of determining the CPU is broken in presence of cross-
	translations (like we do e.g. on ARM). Try to use detect_cpu, which
	seems to have logic to handle that

diff --git a/rpython/rlib/rvmprof/cintf.py b/rpython/rlib/rvmprof/cintf.py
--- a/rpython/rlib/rvmprof/cintf.py
+++ b/rpython/rlib/rvmprof/cintf.py
@@ -10,12 +10,13 @@
 from rpython.rlib import rthread, jit
 from rpython.rlib.objectmodel import we_are_translated
 from rpython.config.translationoption import get_translation_config
+from rpython.jit.backend import detect_cpu
 
 class VMProfPlatformUnsupported(Exception):
     pass
 
 # vmprof works only on x86 for now
-IS_SUPPORTED = host_platform.machine() in ('i686', 'x86_64')
+IS_SUPPORTED = detect_cpu.autodetect().startswith('x86')
 
 ROOT = py.path.local(rpythonroot).join('rpython', 'rlib', 'rvmprof')
 SRC = ROOT.join('src')


More information about the pypy-commit mailing list