diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-06-09 18:57:01 +0100 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-07-06 21:08:10 +0900 |
commit | 039062218957bdae6473b482adc8800fd9be7ed3 (patch) | |
tree | 122e15ab36ea8aa2a2928040f6f159006f42fe10 /tests/context | |
parent | ae59134a32cf7c28d8d0b4ccb5518a2a0c18b97b (diff) | |
download | buildstream-039062218957bdae6473b482adc8800fd9be7ed3.tar.gz |
Add --host-arch and --target-arch, and 'host-arches' conditional
This command adds initial cross-compilation support to BuildStream.
It has been tested against a converted version of the Baserock
compiler bootstrap and used to cross build sysroots for armv8l64 and ppc64l
from an x86_64 host.
For example, to build a sysroot for ARM v8 64-bit you can do this:
bst build --target-arch=armv8b64 gnu-toolchain/stage2.bst
This would cause the adapted Baserock definitions to produce a stage1 simple
cross compiler that runs on the native architecture and produces armv8b64
binaries, and then cross build a stage2 sysroot that executes on armv8b64.
Currently the --host-arch option does nothing of use. It will one day
enable host-incompatible builds using a QEMU-powered cross sandbox.
The `--arch=` option is now shorthand for `--host-arch= --target-arch=`.
Elements have 2 new variables available, %{bst-host-arch} and
%{bst-target-arch}. The 'arches' conditional now follows %{bst-target-arch},
while the new 'host-arches' conditional follows %{bst-host-arch}. All
of --arch, --host-arch and --target-arch default to the output of `uname -a`.
There's no magic here that would make all BuildStream elements suddenly
able to cross compile. It is up to an individual element to support this by
honouring %{bst-target-arch} in whatever way makes sense.
Diffstat (limited to 'tests/context')
-rw-r--r-- | tests/context/context.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/context/context.py b/tests/context/context.py index c09643b75..65f6f51fd 100644 --- a/tests/context/context.py +++ b/tests/context/context.py @@ -30,7 +30,7 @@ def context_fixture(): def test_context_create(context_fixture): context = context_fixture['context'] assert(isinstance(context, Context)) - assert(context.arch == 'x86_64') + assert(context.host_arch == 'x86_64') ####################################### |