NVIDIA Tegra Tegra Linux Driver Package
Development Guide
19.3 Release | July 1, 2014

 
Building Crosstool-ng Toolchain and glibc
 
Toolchain Information
Host Setup
Dependent Packages
Building the Toolchain Suite
Verifying the Build
This chapter provides instructions to build the Crosstool-ng supplied cross toolchain suite version 4.5.3 and the glibc suite with an Ubuntu host machine. The Crosstool-ng toolchain suite is similar to the toolchain used to produce the L4T release binaries.
Note: For an example Crosstool-ng configuration file, see the Appendix.
Toolchain Information
The toolchain consists of the following elements:
Crosstool-ng reference (http://crosstool-ng.org/)
Cross Toolchain Version : 4.5.3
glibc Version : 2.11
Host Setup
Ubuntu host systems must include the following:
Ubuntu 10.04 32-bit distribution (Note: 64-bit distribution is not supported for building the toolchain)
Fast host CPU like Core 2 Duo (to reduce build time)
1GB Free space on HDD
2GB SDRAM
Dependent Packages
On the Ubuntu distribution host machine, ensure the following packages are installed:
mercurial
bison
flex
gperf
texinfo
m4
libtool
automake
Note: The host system must be connected to the internet before running the commands below:
You can install the above packages using the following command:
$ sudo apt-get install mercurial bison flex gperf texinfo m4 libtool automake
Building the Toolchain Suite
To build the toolchain suite, perform the following tasks:
Set the TOP_DIR Environment Variable and Create Directories
Install autoconf-2.68
Configuring crosstool-ng
Invoke the Build
To set the TOP_DIR environment variable and create directories
1. To set the TOP_DIR variable to ${HOME}/crosstool enter the following command:
$ export TOP_DIR="${HOME}/crosstool"
2. In the ${TOP_DIR} directory, create subdirectories:
$ mkdir depends
$ mkdir crosstool-ng
$ cd depends
$ mkdir src
$ mkdir install
$ cd src
$ mkdir autoconf
$ mkdir ct-ng
To instal autoconf-2.68
1. Change to the autoconf directory and download autoconf-2.68.tar.bz2 by executing the following commands:
$ cd ${TOP_DIR}/depends/src/autoconf
$ wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.bz2
2. Extract and configure autoconf-2.68:
$ tar xf autoconf-2.68.tar.bz2
$ cd autoconf-2.68
$ ./configure --prefix=${TOP_DIR}/depends/install/autoconf_install/autoconf-2.68-install
3. Make and install autoconf-2.68:
$ make
$ make install
To configure crosstool-ng
1. Change to the ct-ng directory:
$ cd ${TOP_DIR}/depends/src/ct-ng
2. Add the autoconf-2.68-install directory to your path:
$ export PATH=${TOP_DIR}/depends/install/autoconf_install/autoconf-2.68-install/bin:${PATH}
3. Clone the crosstool-ng repository:
$ hg clone http://crosstool-ng.org/hg/crosstool-ng
4. Configure crosstool-ng:
$ cd crosstool-ng
$ ./bootstrap
$ ./configure --prefix=${TOP_DIR}/depends/install/ct-ng_install/crosstool-ng-hg-install
5. Make and install crosstool-ng:
$ make
$ make install
6. Create the ${TOP_DIR}/crosstool-ng/src directory for locally saving downloaded packages:
mkdir ${TOP_DIR}/crosstool-ng/src
To invoke the build
1. Change to the /crosstool-ng-hg-install/bin directory:
$ cd ${TOP_DIR}/depends/install/ct-ng_install/crosstool-ng-hg-install/bin
2. Copy the following content of .config from the Sample Crosstool-ng Configuration File appendix to this guide to a file called .config.
Note: .config is a hidden file. After creating it, confirm it exists in the correct location by running ls -a in the directory.
3. Build ct-ng using 8 parallel paths:
$./ct-ng oldconfig
$./ct-ng build.8
This will build the complete suite and install the binary components in ${TOP_DIR}/crosstool-ng/install.
Verifying the Build
After a successful build, the following are the directories and files contained in the ${TOP_DIR}/crosstool-ng/install directory, as reported by the tree application (where available).
$ tree -L 2
 
|-- arm-cortex_a9-linux-gnueabi
| |-- bin
| |-- debug-root
| |-- include
| |-- lib -> sysroot/lib
| |-- lib32 -> lib
| |-- lib64 -> lib
| `-- sysroot
|-- bin
| |-- arm-cortex_a9-linux-gnueabi-addr2line
| |-- arm-cortex_a9-linux-gnueabi-ar
| |-- arm-cortex_a9-linux-gnueabi-as
| |-- arm-cortex_a9-linux-gnueabi-c++
| |-- arm-cortex_a9-linux-gnueabi-cc -> arm-cortex_a9-linux-gnueabi-gcc
| |-- arm-cortex_a9-linux-gnueabi-c++filt
| |-- arm-cortex_a9-linux-gnueabi-cpp
| |-- arm-cortex_a9-linux-gnueabi-ct-ng.config
| |-- arm-cortex_a9-linux-gnueabi-g++
| |-- arm-cortex_a9-linux-gnueabi-gcc
| |-- arm-cortex_a9-linux-gnueabi-gcc-4.5.3
| |-- arm-cortex_a9-linux-gnueabi-gccbug
| |-- arm-cortex_a9-linux-gnueabi-gcov
| |-- arm-cortex_a9-linux-gnueabi-gprof
| |-- arm-cortex_a9-linux-gnueabi-ld
| |-- arm-cortex_a9-linux-gnueabi-ldd
| |-- arm-cortex_a9-linux-gnueabi-nm
| |-- arm-cortex_a9-linux-gnueabi-objcopy
| |-- arm-cortex_a9-linux-gnueabi-objdump
| |-- arm-cortex_a9-linux-gnueabi-populate
| |-- arm-cortex_a9-linux-gnueabi-ranlib
| |-- arm-cortex_a9-linux-gnueabi-readelf
| |-- arm-cortex_a9-linux-gnueabi-size
| |-- arm-cortex_a9-linux-gnueabi-strings
| `-- arm-cortex_a9-linux-gnueabi-strip
|-- build.log.bz2
|-- include
|-- lib
| |-- gcc
| |-- ldscripts
| `-- libiberty.a
|-- libexec
| `-- gcc
`-- share
`-- gcc-4.5.3