optee_client git contains the source code for the TEE client library in Linux. This component provides the TEE Client API as defined by the GlobalPlatform TEE standard. It is distributed under the BSD 2-clause open source license.
In this git there are two main targets/binaries to build. There is
libteec.so, which is the library that contains that API for communication
with the Trusted OS. Then there is
tee-supplicant which is a daemon serving
the Trusted OS in secure world with miscellaneous features, such as file system
You can build the code in this git only or build it as part of the entire system, i.e. as a part of a full OP-TEE developer setup. For the latter, please refer to instructions at the build page. For standalone builds we currently support building with both CMake as well as with regular GNU Makefiles.
Configure the toolchain¶
First step is to download and configure a toolchain, see the Toolchains page for instructions.
$ git clone https://github.com/OP-TEE/optee_client $ cd optee_client
Build using CMake¶
$ mkdir build $ cd build $ cmake -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc .. $ make
This example uses the 32-bit toolchain (arm-linux-gnueabihf-), the same works using the 64-bit toolchain (aarch64-linux-gnu-).
After this step the compiled binaries can be sound in sub-folders of
If you have a need or preference to install the binaries at some specific
location, then on the cmake line above add
-DCMAKE_INSTALL_PREFIX=<my-install-path> as an additional argument. With
that you can then run
make install and the binaries etc will be copied to
the location that you gave as an argument. In this example
$ cmake -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_INSTALL_PREFIX=/tmp/optee_client .. $ make $ make install
Build using GNU Make¶
Makefile is configured to use
arm-linux-gnueabihf- by default.
For a 64-bit builds (or any other toolchain) you will need to use
$ make CROSS_COMPILE=aarch64-linux-gnu-
After this step the compiled binaries can be found in the sub-folder
To be able to see all commands when building you could build using following flags:
$ make V=1
$ make VERBOSE=1