summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--morphlib/__init__.py2
-rw-r--r--morphlib/buildcommand.py6
-rw-r--r--morphlib/buildenvironment.py3
-rw-r--r--morphlib/util.py1
4 files changed, 11 insertions, 1 deletions
diff --git a/morphlib/__init__.py b/morphlib/__init__.py
index 0c9284d8..90cc3d80 100644
--- a/morphlib/__init__.py
+++ b/morphlib/__init__.py
@@ -37,7 +37,7 @@ __version__ = gitversion.version
# List of architectures that Morph supports
-valid_archs = ['armv7l', 'armv7lhf', 'armv7b', 'testarch', 'x86_32',
+valid_archs = ['armv5l', 'armv7l', 'armv7lhf', 'armv7b', 'testarch', 'x86_32',
'x86_64', 'ppc64', 'armv8l64', 'armv8b64', 'mips32l',
'mips32b', 'mips64l', 'mips64b']
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py
index fd5acdf5..37dccf82 100644
--- a/morphlib/buildcommand.py
+++ b/morphlib/buildcommand.py
@@ -141,6 +141,12 @@ class BuildCommand(object):
if host_arch == 'armv8b' and root_arch in ('armv7b', 'armv7bhf'):
return
+ # Since the armv7 instruction set is nearly entirely armv5 compatible,
+ # and since the incompatibilities are appropriately trapped in the
+ # kernel, we can safely run any armv5 toolchain natively on armv7.
+ if host_arch in ('armv7l', 'armv7lhf') and root_arch in 'armv5l':
+ return
+
raise morphlib.Error(
'Are you trying to cross-build? Host architecture is %s but '
'target is %s' % (host_arch, root_arch))
diff --git a/morphlib/buildenvironment.py b/morphlib/buildenvironment.py
index 266510f6..f8e88b84 100644
--- a/morphlib/buildenvironment.py
+++ b/morphlib/buildenvironment.py
@@ -115,6 +115,9 @@ class BuildEnvironment():
if arch == 'x86_32':
cpu = 'i686'
abi = ''
+ elif arch.startswith('armv5'): #pragma: no cover
+ cpu = arch
+ abi = 'eabi'
elif arch.startswith('armv7'):
cpu = arch
abi = 'eabi'
diff --git a/morphlib/util.py b/morphlib/util.py
index 904dc355..70808cac 100644
--- a/morphlib/util.py
+++ b/morphlib/util.py
@@ -470,6 +470,7 @@ def get_host_architecture(): # pragma: no cover
'i486': 'x86_32',
'i586': 'x86_32',
'i686': 'x86_32',
+ 'armv5l': 'armv5l',
'armv7l': 'armv7l',
'armv7b': 'armv7b',
'armv8l': 'armv8l',