1*91f16700SchasingluluPrerequisites 2*91f16700Schasinglulu============= 3*91f16700Schasinglulu 4*91f16700SchasingluluThis document describes the software requirements for building |TF-A| for 5*91f16700SchasingluluAArch32 and AArch64 target platforms. 6*91f16700Schasinglulu 7*91f16700SchasingluluIt may possible to build |TF-A| with combinations of software packages that are 8*91f16700Schasingluludifferent from those listed below, however only the software described in this 9*91f16700Schasingluludocument can be officially supported. 10*91f16700Schasinglulu 11*91f16700SchasingluluBuild Host 12*91f16700Schasinglulu---------- 13*91f16700Schasinglulu 14*91f16700Schasinglulu|TF-A| can be built using either a Linux or a Windows machine as the build host. 15*91f16700Schasinglulu 16*91f16700SchasingluluA relatively recent Linux distribution is recommended for building |TF-A|. We 17*91f16700Schasingluluhave performed tests using Ubuntu 22.04 LTS (64-bit) but other distributions 18*91f16700Schasinglulushould also work fine as a base, provided that the necessary tools and libraries 19*91f16700Schasinglulucan be installed. 20*91f16700Schasinglulu 21*91f16700Schasinglulu.. _prerequisites_toolchain: 22*91f16700Schasinglulu 23*91f16700SchasingluluToolchain 24*91f16700Schasinglulu--------- 25*91f16700Schasinglulu 26*91f16700Schasinglulu|TF-A| can be built with any of the following *cross-compiler* toolchains that 27*91f16700Schasinglulutarget the Armv7-A or Armv8-A architectures: 28*91f16700Schasinglulu 29*91f16700Schasinglulu- TF-A has been tested with version 12.3.Rel1 (gcc 12.3) from the `Arm Developer website`_ 30*91f16700Schasinglulu 31*91f16700Schasinglulu You will need the targets ``arm-none-eabi`` and ``aarch64-none-elf`` for 32*91f16700Schasinglulu AArch32 and AArch64 builds respectively. 33*91f16700Schasinglulu 34*91f16700Schasinglulu- Clang == 14.0.0 35*91f16700Schasinglulu- Arm Compiler == 6.18 36*91f16700Schasinglulu 37*91f16700SchasingluluIn addition, a native compiler is required to build the supporting tools. 38*91f16700Schasinglulu 39*91f16700Schasinglulu.. note:: 40*91f16700Schasinglulu Versions greater than the ones specified are likely but not guaranteed to 41*91f16700Schasinglulu work. This is predominantly because TF-A carries its own copy of compiler-rt, 42*91f16700Schasinglulu which may be older than the version expected by the compiler. Fixes and bug 43*91f16700Schasinglulu reports are always welcome. 44*91f16700Schasinglulu 45*91f16700Schasinglulu.. note:: 46*91f16700Schasinglulu The software has also been built on Windows 7 Enterprise SP1, using CMD.EXE, 47*91f16700Schasinglulu Cygwin, and Msys (MinGW) shells, using version 5.3.1 of the GNU toolchain. 48*91f16700Schasinglulu 49*91f16700Schasinglulu.. note:: 50*91f16700Schasinglulu For instructions on how to select the cross compiler refer to 51*91f16700Schasinglulu :ref:`Performing an Initial Build`. 52*91f16700Schasinglulu 53*91f16700Schasinglulu.. _prerequisites_software_and_libraries: 54*91f16700Schasinglulu 55*91f16700SchasingluluSoftware and Libraries 56*91f16700Schasinglulu---------------------- 57*91f16700Schasinglulu 58*91f16700SchasingluluThe following tools are required to obtain and build |TF-A|: 59*91f16700Schasinglulu 60*91f16700Schasinglulu- An appropriate toolchain (see :ref:`prerequisites_toolchain`) 61*91f16700Schasinglulu- GNU Make 62*91f16700Schasinglulu- Git 63*91f16700Schasinglulu 64*91f16700SchasingluluThe following libraries must be available to build one or more components or 65*91f16700Schasinglulusupporting tools: 66*91f16700Schasinglulu 67*91f16700Schasinglulu- OpenSSL >= 1.1.1 (v3.0.0 to v3.0.6 highly discouraged due to security issues) 68*91f16700Schasinglulu 69*91f16700Schasinglulu Required to build the cert_create, encrypt_fw, and fiptool tools. 70*91f16700Schasinglulu 71*91f16700Schasinglulu .. note:: 72*91f16700Schasinglulu 73*91f16700Schasinglulu If using OpenSSL 3, older Linux versions may require it to be built from 74*91f16700Schasinglulu source code, as it may not be available in the default package repositories. 75*91f16700Schasinglulu Please refer to the OpenSSL project documentation for more information. 76*91f16700Schasinglulu 77*91f16700SchasingluluThe following libraries are required for Trusted Board Boot and Measured Boot 78*91f16700Schasinglulusupport: 79*91f16700Schasinglulu 80*91f16700Schasinglulu- mbed TLS == 3.4.1 (tag: ``mbedtls-3.4.1``) 81*91f16700Schasinglulu 82*91f16700SchasingluluThese tools are optional: 83*91f16700Schasinglulu 84*91f16700Schasinglulu- Device Tree Compiler (DTC) >= 1.4.7 85*91f16700Schasinglulu 86*91f16700Schasinglulu Needed if you want to rebuild the provided Flattened Device Tree (FDT) 87*91f16700Schasinglulu source files (``.dts`` files). DTC is available for Linux through the package 88*91f16700Schasinglulu repositories of most distributions. 89*91f16700Schasinglulu 90*91f16700Schasinglulu- Arm `Development Studio (Arm-DS)`_ 91*91f16700Schasinglulu 92*91f16700Schasinglulu The standard software package used for debugging software on Arm development 93*91f16700Schasinglulu platforms and |FVP| models. 94*91f16700Schasinglulu 95*91f16700Schasinglulu- Node.js >= 16 96*91f16700Schasinglulu 97*91f16700Schasinglulu Highly recommended, and necessary in order to install and use the packaged 98*91f16700Schasinglulu Git hooks and helper tools. Without these tools you will need to rely on the 99*91f16700Schasinglulu CI for feedback on commit message conformance. 100*91f16700Schasinglulu 101*91f16700Schasinglulu- Poetry >= 1.3.2 102*91f16700Schasinglulu 103*91f16700Schasinglulu Required for managing Python dependencies, this will allow you to reliably 104*91f16700Schasinglulu reproduce a Python environment to build documentation and run analysis tools. 105*91f16700Schasinglulu Most importantly, it ensures your system environment will not be affected by 106*91f16700Schasinglulu dependencies in the Python scripts. 107*91f16700Schasinglulu 108*91f16700SchasingluluPackage Installation (Linux) 109*91f16700Schasinglulu^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 110*91f16700Schasinglulu 111*91f16700SchasingluluIf you are using the recommended Ubuntu distribution then you can install the 112*91f16700Schasinglulurequired packages with the following command: 113*91f16700Schasinglulu 114*91f16700Schasinglulu.. code:: shell 115*91f16700Schasinglulu 116*91f16700Schasinglulu sudo apt install build-essential git 117*91f16700Schasinglulu 118*91f16700SchasingluluThe optional packages can be installed using: 119*91f16700Schasinglulu 120*91f16700Schasinglulu.. code:: shell 121*91f16700Schasinglulu 122*91f16700Schasinglulu sudo apt install device-tree-compiler 123*91f16700Schasinglulu 124*91f16700SchasingluluAdditionally, to install a version of Node.js compatible with TF-A's repository 125*91f16700Schasingluluscripts, you can use the `Node Version Manager`_. To install both NVM and an 126*91f16700Schasingluluappropriate version of Node.js, run the following **from the root directory of 127*91f16700Schasingluluthe repository**: 128*91f16700Schasinglulu 129*91f16700Schasinglulu.. code:: shell 130*91f16700Schasinglulu 131*91f16700Schasinglulu curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash 132*91f16700Schasinglulu exec "$SHELL" -ic "nvm install; exec $SHELL" 133*91f16700Schasinglulu 134*91f16700Schasinglulu.. _Node Version Manager: https://github.com/nvm-sh/nvm#install--update-script 135*91f16700Schasinglulu 136*91f16700SchasingluluSupporting Files 137*91f16700Schasinglulu---------------- 138*91f16700Schasinglulu 139*91f16700SchasingluluTF-A has been tested with pre-built binaries and file systems from `Linaro 140*91f16700SchasingluluRelease 20.01`_. Alternatively, you can build the binaries from source using 141*91f16700Schasingluluinstructions in :ref:`Performing an Initial Build`. 142*91f16700Schasinglulu 143*91f16700Schasinglulu.. _prerequisites_get_source: 144*91f16700Schasinglulu 145*91f16700SchasingluluGetting the TF-A Source 146*91f16700Schasinglulu----------------------- 147*91f16700Schasinglulu 148*91f16700SchasingluluSource code for |TF-A| is maintained in a Git repository hosted on 149*91f16700SchasingluluTrustedFirmware.org. To clone this repository from the server, run the following 150*91f16700Schasingluluin your shell: 151*91f16700Schasinglulu 152*91f16700Schasinglulu.. code:: shell 153*91f16700Schasinglulu 154*91f16700Schasinglulu git clone "https://review.trustedfirmware.org/TF-A/trusted-firmware-a" 155*91f16700Schasinglulu 156*91f16700SchasingluluAdditional Steps for Contributors 157*91f16700Schasinglulu^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 158*91f16700Schasinglulu 159*91f16700SchasingluluIf you are planning on contributing back to TF-A, there are some things you'll 160*91f16700Schasingluluwant to know. 161*91f16700Schasinglulu 162*91f16700SchasingluluTF-A is hosted by a `Gerrit Code Review`_ server. Gerrit requires that all 163*91f16700Schasinglulucommits include a ``Change-Id`` footer, and this footer is typically 164*91f16700Schasingluluautomatically generated by a Git hook installed by you, the developer. 165*91f16700Schasinglulu 166*91f16700SchasingluluIf you have Node.js installed already, you can automatically install this hook, 167*91f16700Schasinglulualong with any additional hooks and Javascript-based tooling that we use, by 168*91f16700Schasinglulurunning from within your newly-cloned repository: 169*91f16700Schasinglulu 170*91f16700Schasinglulu.. code:: shell 171*91f16700Schasinglulu 172*91f16700Schasinglulu npm install --no-save 173*91f16700Schasinglulu 174*91f16700SchasingluluIf you have opted **not** to install Node.js, you can install the Gerrit hook 175*91f16700Schasinglulumanually by running: 176*91f16700Schasinglulu 177*91f16700Schasinglulu.. code:: shell 178*91f16700Schasinglulu 179*91f16700Schasinglulu curl -Lo $(git rev-parse --git-dir)/hooks/commit-msg https://review.trustedfirmware.org/tools/hooks/commit-msg 180*91f16700Schasinglulu chmod +x $(git rev-parse --git-dir)/hooks/commit-msg 181*91f16700Schasinglulu 182*91f16700SchasingluluYou can read more about Git hooks in the *githooks* page of the Git 183*91f16700Schasingluludocumentation, available `here <https://git-scm.com/docs/githooks>`_. 184*91f16700Schasinglulu 185*91f16700Schasinglulu-------------- 186*91f16700Schasinglulu 187*91f16700Schasinglulu*Copyright (c) 2021-2023, Arm Limited. All rights reserved.* 188*91f16700Schasinglulu 189*91f16700Schasinglulu.. _Arm Developer website: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads 190*91f16700Schasinglulu.. _Gerrit Code Review: https://www.gerritcodereview.com/ 191*91f16700Schasinglulu.. _Linaro Release Notes: https://community.arm.com/dev-platforms/w/docs/226/old-release-notes 192*91f16700Schasinglulu.. _Linaro instructions: https://community.arm.com/dev-platforms/w/docs/304/arm-reference-platforms-deliverables 193*91f16700Schasinglulu.. _Development Studio (Arm-DS): https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio 194*91f16700Schasinglulu.. _Linaro Release 20.01: http://releases.linaro.org/members/arm/platforms/20.01 195