Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.

Building ARM baremetal GCC

From Texas Instruments Wiki
Jump to: navigation, search

Introduction

This page is a placeholder for building ARM baremetal GCC toolchain. Perhaps it will be extended to other toolchains.
Rebuilding GCC is necessary if patches or the bleeding edge is required to be built.

Prerequisites

To build GCC for both Linux and Windows you will need a Linux machine at your disposal. Ubuntu 14.04/64 is used throughout this document, as well as GCC ARM 4.9-2015-q1.

  • Download the sources for the ARM GCC 4.9-2015-q1 from:
https://launchpad.net/gcc-arm-embedded/+download
There are many files to be downloaded at this page. The sources usually have a suffix -src.tar.bz2.
  • Download the build instructions in PDF format from the same page above
The file is named <How-to-build-toolchain.pdf>
  • Install the dependencies shown at page 7 (section 1.2.3) of the document above. For convenience, the complete command line is shown below with the packages relefant to ubuntu 14.04/64:
  • Install mingw software from Ubuntu directly:
user@host:~/$ sudo apt-get install p7zip-full gawk gzip perl autoconf m4 automake libtool libncurses5-dev gettext gperf dejagnu expect tcl autogen flex flip bison tofrodos texinfo gcc-multilib libgmp3-dev libmpfr-dev debhelper texlive texlive-extra-utils
  • Install mingw software from Ubuntu directly (to build for Windows):
user@host:~/$ sudo apt-get install mingw-w64 mingw-w64-x86-64-dev mingw-w64-tools (for 64-bit binary)
user@host:~/$ sudo apt-get install mingw-w64 mingw-w64-i686-dev mingw-w64-tools (for 32-bit binary)


Build procedure

When building GCC, keep in mind there are some issues with the current procedure described in the document <How-to-build-toolchain.pdf>.

  • The sources have a dependency on Installjammer - however, Installjammer is not supported anymore by its main developer.
This dependency is probably required to create a fancy installer executable but it is not required to actually use the tool. Therefore, it is not installed.
The only drawback is the build does not finish completely - i.e., it fails at the very end. However, this also does not affect the functionality of the tool.
  • The sources automatically create documentation usign TeX and a dvi converter, but both weren't properly found in Ubuntu 14.04 packages.
To workaround this, simply build the toolchain without documentation (more on this on the build steps)


At this point the procedure is very similar to what is presented in section 1.3 of the <How-to-build-toolchain.pdf> document, but some differences are highlighted
1. Create a toolchain directory in the user area

user@host:~/$mkdir toolchain
user@host:~/$cd toolchain


2. Follow the steps in section 1.3 of the <How-to-build-toolchain.pdf> document, only changing the actual build command to account for the issues mentioend above.

user@host:~/$./build-prerequisites.sh --build_tools=/usr/bin/
user@host:~/$./build-toolchain.sh --build_tools=/usr/bin/ --skip_steps=manual


3. If all the dependencies are correctly installed, the build should only fail at the very end with a problem finding the Installjammer package. However, all versions will be located under the subdirectories below:

Linux: /home/user/toolchain/gcc-arm-none-eabi-4_9-2015q1-20150306/install-native
Windows: /home/user/toolchain/gcc-arm-none-eabi-4_9-2015q1-20150306/install-mingw


4. Simply copy the Linux version to your preferred directory or the windows version to your preferred media (USB pendrive, SD card, SMB share, etc.) and enjoy.