Toolchains¶
OP-TEE uses both 32bit as well as 64bit toolchains and it is even possible to mix them in some configurations. In theory you should be able to compile OP-TEE with the Arm toolchains that are coming with your Linux distribution. But instead of using those directly, we instead download the toolchains directly from Arm.
Download/install¶
We propose two ways to download the toolchains, both will put the toolchains under the same path(s).
Direct download¶
Go the Arm GCC download page and download the “AArch32 target with soft
float (arm-linux-gnueabi)” for 32bit builds and the “AArch64 GNU/Linux target
(aarch64-linux-gnu)” for 64bit builds. When the downloads have finished, you
will untar them to a location that you later on will export to your $PATH
.
Here is an example
$ mkdir -p $HOME/toolchains
$ cd $HOME/toolchains
# Download 32bit toolchain
$ wget https://developer.arm.com/-/media/Files/downloads/gnu-a/8.2-2019.01/gcc-arm-8.2-2019.01-x86_64-arm-linux-gnueabi.tar.xz
$ mkdir aarch32
$ tar xf gcc-arm-8.2-2019.01-x86_64-arm-linux-gnueabi.tar.xz -C aarch32 --strip-components=1
# Download 64bit toolchain
$ wget https://developer.arm.com/-/media/Files/downloads/gnu-a/8.2-2019.01/gcc-arm-8.2-2019.01-x86_64-aarch64-linux-gnu.tar.xz
$ mkdir aarch64
$ tar xf gcc-arm-8.2-2019.01-x86_64-aarch64-linux-gnu.tar.xz -C aarch64 --strip-components=1
Export PATH¶
If you have downloaded the toolchains as described above, you should have them
at $HOME/toolchains/{aarch32/aarch64}
, so now we just need to export the
paths and then you are ready to starting compiling OP-TEE components.
$ export PATH=$PATH:$HOME/toolchains/aarch32/bin:$HOME/toolchains/aarch64/bin