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).
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
Clone my customized Linaro CrossTool-NG repository
git clone https://github.com/Christopher83/linaro_crosstool-ng.git
Clone Linaro CrossTool-NG repository
bzr branch lp:~linaro-toolchain-dev/crosstool-ng/linaro crosstool-ng
Clone Standard CrossTool-NG repository
hg clone http://crosstool-ng.org/hg/crosstool-ng
If you chose 2B or 2C, download, if you wish, the compressed archive containing my configuration files
and unzip it inside the folder crosstool-ng/samples
is the folder of the builder sources you previously cloned)
Configure the folder where you would like to install the builder script (replace /crosstool-ng_install_path with the absolute path you prefer
./bootstrap # Needed if you chose 2B and 2C
Build the sources and install the builder:
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
and add, at the bottom of the file, the reference to the installation location of the builder /crosstool-ng_install_path
You should be ready, try running these commands
Display the script help
View the list of samples configurations
Display the information about a sample configuration
ct-ng show config_name
Now proceed with the configuration of your toolchain
Starting from a default configuration file sample
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
Starting from one of my configurations you can find inside the samples package
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:
The same may be necessary for the other tools.
Build your toolchain (replace the 4 with the number of parallel jobs that you want, based on your number of cores)
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.
If the build fails, write down the last step was successful, check the error message and correct the configuration or install any missing package.
You can get a list of the steps that can be used by running
After resolving the problem, you can restore the build simply running (replace last_successfull_step with your successfull built step)
The + after the name of the step means "restart from the step after the one indicated"
I hope I'm not missing anything.
Let me know...