From 154a760fb884cee14c2604b8bfbe52b0e7c0d4b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Wed, 22 Apr 2015 19:29:56 +0100 Subject: Add armv5l to list of valid architectures Also add support to allow building compatible architectures on armv7 machines, as per the rationale in the comment in _validate_architecture(). Change-Id: Ie0fe4002523f1f92f576bac8b654d4ea6fad5cf2 --- morphlib/__init__.py | 2 +- morphlib/buildcommand.py | 6 ++++++ morphlib/buildenvironment.py | 3 +++ morphlib/util.py | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) 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', -- cgit v1.2.1