Author: Richard Plangger <[email protected]>
Branch: s390x-old-cpu-no-jit
Changeset: r85531:3a21d6a5c5bc
Date: 2016-07-04 11:02 +0200
http://bitbucket.org/pypy/pypy/changeset/3a21d6a5c5bc/
Log: (s390x) add a config switch, not supported cpu revisions build a no
jit version. #2318
diff --git a/pypy/goal/targetpypystandalone.py
b/pypy/goal/targetpypystandalone.py
--- a/pypy/goal/targetpypystandalone.py
+++ b/pypy/goal/targetpypystandalone.py
@@ -12,6 +12,7 @@
from pypy import pypydir
from rpython.rlib import rthread
from pypy.module.thread import os_thread
+from platform import machine
thisdir = py.path.local(__file__).dirpath()
@@ -276,6 +277,17 @@
elif config.objspace.usemodules.pypyjit:
config.translation.jit = True
+ # s390x build a no jit version on older CPUs
+ if config.translation.jit and machine() == 's390x':
+ from rpython.translator.platform.arch.s390x import
s390x_cpu_revision
+ cpu_revision = s390x_cpu_revision()
+ if cpu_revision == "unknown":
+ # this CPU might be very old! Thus we turn off
+ # the JIT, ve
+ config.translation.jit = False
+ print >> sys.stderr, "(s390x) turning off JIT. " \
+ "CPU revision is not supported"
+
if config.translation.sandbox:
config.objspace.lonepycfiles = False
diff --git a/rpython/translator/platform/arch/s390x.py
b/rpython/translator/platform/arch/s390x.py
--- a/rpython/translator/platform/arch/s390x.py
+++ b/rpython/translator/platform/arch/s390x.py
@@ -80,7 +80,7 @@
# gcc does not recognize z13 as a compiler flag!
revision = 'zEC12'
- assert revision != 'unknown'
- cflags += ('-march='+revision,)
+ if revision != 'unknown':
+ cflags += ('-march='+revision,)
cflags += ('-m64','-mzarch')
return cflags
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit