summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-12-19 12:35:26 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-12-19 12:36:06 +0000
commitf33748d6e6795751e7ea628d5f4e8478353a88ee (patch)
treedd042a85d951a2a0c4af121b9b89c267c7bfd8df
parentd565903ed91a183f2768290dd63dc1a306b8e1a3 (diff)
parent86e1cc90caf265463df92187926ce20bf5d8c85e (diff)
downloadmorph-f33748d6e6795751e7ea628d5f4e8478353a88ee.tar.gz
Merge branch 'emmet/armv8'
Reviewed-By: Richard Ipsum <richard.ipsum@codethink.co.uk> Reviewed-By: Richard Maw <richard.maw@codethink.co.uk> Reviewed-By: Sam Thursfield <sam.thursfield@codethink.co.uk>
-rw-r--r--morphlib/buildcommand.py20
-rw-r--r--morphlib/util.py4
2 files changed, 19 insertions, 5 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py
index a658fc55..527163f6 100644
--- a/morphlib/buildcommand.py
+++ b/morphlib/buildcommand.py
@@ -126,11 +126,21 @@ class BuildCommand(object):
root_arch = root_artifact.source.morphology['arch']
host_arch = morphlib.util.get_host_architecture()
- if root_arch != host_arch:
- raise morphlib.Error(
- 'Are you trying to cross-build? '
- 'Host architecture is %s but target is %s'
- % (host_arch, root_arch))
+
+ if root_arch == host_arch:
+ return
+
+ # Since the armv8 instruction set is nearly entirely armv7 compatible,
+ # and since the incompatibilities are appropriately trapped in the
+ # kernel, we can safely run any armv7 toolchain natively on armv8.
+ if host_arch == 'armv8l' and root_arch in ('armv7l', 'armv7lhf'):
+ return
+ if host_arch == 'armv8b' and root_arch in ('armv7b', 'armv7bhf'):
+ return
+
+ raise morphlib.Error(
+ 'Are you trying to cross-build? Host architecture is %s but '
+ 'target is %s' % (host_arch, root_arch))
@staticmethod
def _validate_has_non_bootstrap_chunks(srcpool):
diff --git a/morphlib/util.py b/morphlib/util.py
index e7a8a50e..63e85b6c 100644
--- a/morphlib/util.py
+++ b/morphlib/util.py
@@ -465,6 +465,10 @@ def get_host_architecture(): # pragma: no cover
'i686': 'x86_32',
'armv7l': 'armv7l',
'armv7b': 'armv7b',
+ 'armv8l': 'armv8l',
+ 'armv8b': 'armv8b',
+ 'aarch64': 'aarch64',
+ 'aarch64b': 'aarch64b',
'ppc64': 'ppc64'
}