summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2013-11-04 16:28:06 +0000
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2013-11-04 16:38:59 +0000
commit0247be267879f6b36a175d2f545a74bfd2c6ae25 (patch)
tree5590b45b4c7a75ba993ccf10be45ac64a03c2b74
parent6a1d074bfd30d5d24faf02725542ec87509c310a (diff)
downloadmorph-0247be267879f6b36a175d2f545a74bfd2c6ae25.tar.gz
Add armhf detection
-rw-r--r--morphlib/util.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/morphlib/util.py b/morphlib/util.py
index 04df0633..d60c08c3 100644
--- a/morphlib/util.py
+++ b/morphlib/util.py
@@ -15,6 +15,7 @@
import os
import re
+import subprocess
import morphlib
import logging
@@ -388,6 +389,11 @@ def parse_environment_pairs(env, pairs):
return dict(env.items() + extra_env.items())
+def has_hardware_fp():
+ output = subprocess.check_output(['readelf', '-A', '/proc/self/exe'])
+ return 'Tag_ABI_VFP_args: VFP registers' in output
+
+
def get_host_architecture(): # pragma: no cover
'''Get the canonical Morph name for the host's architecture.'''
@@ -406,6 +412,9 @@ def get_host_architecture(): # pragma: no cover
if machine not in table:
raise morphlib.Error('Unknown host architecture %s' % machine)
+ if machine == 'armv7l' and has_hardware_fp():
+ return 'armv7lhf'
+
return table[machine]