diff mx/mx_graal.py @ 17012:ad10671d1bbd

mx: move get_arch() to mxtool
author Bernhard Urban <bernhard.urban@jku.at>
date Tue, 02 Sep 2014 14:45:51 +0200
parents e9ff3e7055e5
children 6a30738791f7
line wrap: on
line diff
--- a/mx/mx_graal.py	Tue Sep 02 10:30:28 2014 +0200
+++ b/mx/mx_graal.py	Tue Sep 02 14:45:51 2014 +0200
@@ -199,7 +199,7 @@
 
     infos['jdkversion'] = str(mx.java().version)
 
-    infos['architecture'] = _arch()
+    infos['architecture'] = mx.get_arch()
     infos['platform'] = mx.get_os()
 
     if mx.get_os != 'windows':
@@ -346,22 +346,6 @@
 
     _run_benchmark(args, sanitycheck.dacapoScalaSanityWarmup.keys(), launcher)
 
-def _arch():
-    machine = platform.uname()[4]
-    if machine in ['amd64', 'AMD64', 'x86_64', 'i86pc']:
-        return 'amd64'
-    if machine in ['sun4v', 'sun4u']:
-        return 'sparcv9'
-    if machine == 'i386' and mx.get_os() == 'darwin':
-        try:
-            # Support for Snow Leopard and earlier version of MacOSX
-            if subprocess.check_output(['sysctl', '-n', 'hw.cpu64bit_capable']).strip() == '1':
-                return 'amd64'
-        except OSError:
-            # sysctl is not available
-            pass
-    mx.abort('unknown or unsupported architecture: os=' + mx.get_os() + ', machine=' + machine)
-
 def _vmLibDirInJdk(jdk):
     """
     Get the directory within a JDK where the server and client
@@ -371,14 +355,14 @@
         return join(jdk, 'jre', 'lib')
     if platform.system() == 'Windows':
         return join(jdk, 'jre', 'bin')
-    return join(jdk, 'jre', 'lib', _arch())
+    return join(jdk, 'jre', 'lib', mx.get_arch())
 
 def _vmCfgInJdk(jdk):
     """
     Get the jvm.cfg file.
     """
     if platform.system() == 'Windows':
-        return join(jdk, 'jre', 'lib', _arch(), 'jvm.cfg')
+        return join(jdk, 'jre', 'lib', mx.get_arch(), 'jvm.cfg')
     return join(_vmLibDirInJdk(jdk), 'jvm.cfg')
 
 def _jdksDir():
@@ -1952,7 +1936,7 @@
     flavor = 'intel'
     if 'att' in args:
         flavor = 'att'
-    lib = mx.add_lib_suffix('hsdis-' + _arch())
+    lib = mx.add_lib_suffix('hsdis-' + mx.get_arch())
     path = join(_graal_home, 'lib', lib)
 
     sha1s = {