[Galaxy S Plus I9001 Android Development] Christopher83:
HOW TO: Build your customized Cross Compiler Toolchain​

This is a guide to make a custom build of your toolchain on Ubuntu Linux (I use version 12.10 and 13.04, but should also fit on 12.04).

1) Open the terminal, install the following packages (I hope the list is complete, let me know if something is missing):

sudo apt-get install mercurial mercurial-common flex bison gperf ncurses-dev texinfo gcc g++ \
autoconf automake libtool gawk patch autotools-dev libsigsegv2 libmpfr-dev libgmp-dev \
libltdl-dev libgmpxx4ldbl libmpc-dev expat libexpat1-dev libpython3.3 libpython3.3-stdlib \
libssl-dev libssl-dev zlib1g-dev subversion

2A) Clone my customized CrossTool-NG repository

For latest builds:

git clone https://github.com/Christopher83/crosstool-ng.git

For 2014 builds:

git clone https://github.com/Christopher83/linaro_crosstool-ng.git

OR 2B) Clone Linaro CrossTool-NG repository

bzr branch lp:~linaro-toolchain-dev/crosstool-ng/linaro crosstool-ng

OR 2C) Clone Standard CrossTool-NG repository

hg clone http://crosstool-ng.org/hg/crosstool-ng

3) If you chose 2B or 2C, download, if you wish, the compressed archive containing my configuration files

Sample configs for Linaro CrossTool-NG

Sample configs for Standard CrossTool-NG
​

and unzip it inside the folder crosstool-ng/samples (note: crosstool-ng is the folder of the builder sources you previously cloned)

4) Configure the folder where you would like to install the builder script (

replace /crosstool-ng_install_path with the absolute path you prefer

):

cd crosstool-ng
./bootstrap # If present, it's needed only for some versions of crosstool-NG
./configure --prefix=[I]/crosstool-ng_install_path[/I]

5) Build the sources and install the builder:

make
make install

Within your target folder /crosstool-ng_install_path you will find a new folder named bin with only an executable script named ct-ng

Edit your .bashrc

gedit ~/.bashrc

and add, at the bottom of the file, the reference to the installation location of the builder

/crosstool-ng_install_path

export PATH=${PATH}:[I]/crosstool-ng_install_path[/I]

6) You should be ready, try running these commands

Display the script help

ct-ng help

View the list of samples configurations

ct-ng list-samples

Display the information about a sample configuration

ct-ng show [I]config_name[/I]

7) Now proceed with the configuration of your toolchain

7A) Starting from a default configuration file sample

ct-ng arm-unknown-linux-gnueabi
ct-ng menuconfig

Remember to enable debugging, so if something goes wrong you can restart from the last successfull step

Paths and misc options --->
(*) Debug crosstool-NG
( ) Pause between every steps
(*) Save intermediate steps
(*) gzip saved states

7B) Starting from one of my configurations you can find inside the samples package

ct-ng [I]chosen_configuration_name[/I]
ct-ng menuconfig

If the GCC version or the Linux version is not ready also after the sync of ct_ng repo, you have to temporarly edit the files:

- config/cc/gcc.in

- config/kernel/linux.in

The same may be necessary for the other tools.

8) Build your toolchain (replace the 4 with the number of parallel jobs that you want, based on your number of cores)

ct-ng build.4

The build process takes a long time, depending on your network speed (you need to download all the source packages of the tools and libraries of the toolchain) and on your PC configuration.

I hope I'm not missing anything.

Let me know...