I like to work on my ARM board [QQ2440] which is based on Samsung S3C2440 ARM CPU. At first when I started to work, I worked with readily avaliable toolchains like those available from CodeSourcery, but I always wanted to try and build the toolchain from scratch. At first I searched web to find the steps like this and that but I wanted a much cool solution, something that is elegant and at the same time powerful. So, I came across this wonderful tool, CrossTool-NG. This the advanced version of its father CrossTool. So I went on and decided to give it a try.
Below are the steps to follow:
- Download the latest CrossTool-NG tarball.
- Extract to a location using the command
tar -xjvf crosstool-ng-1.9.0.tar.bz2
- Now compile and install, please note you need root privilege to install, I normally do by making use of "sudo"
cd crosstool-ng-1.9.0 ./configure make sudo make install
Now we are finished with the simple installation steps of CrossTool, and here comes the steps to build a brand new toolchain of our own. We start by creating a directory, say "toolchain" where all the build is going to happen. Below are the steps
- Change to the new created directory and configure your toolchain by following command
cd toolchain ct-ng menuconfig
- Now setup some path variables and paths
- During the build, the tarballs are download and saved to the path, here "/home/sachin/shared"
- Need to set the architecture parameters
- Some other toolchain options, set the tuples alias, good when you like to use standard alias like "arm-linux" for your toolchain.
- Choose the kernel version against which you will be going to build the kernel. You need to careful here, as choosing the latest version might lead to a situation that, when you build older kernels, the busybox will show nasty old kernel errors. So I choose long-term stable 2.6.32.x
- So in this way you can continue with your adventure, or download the ready made config file from here.
[sachin@xpress toolchain]$ ct-ng build
[INFO ] Performing some trivial sanity checks
[INFO ] Build started 20101210.124223
[INFO ] Building environment variables
[INFO ] =================================================================
[INFO ] Retrieving needed toolchain components' tarballs
[INFO ] Retrieving needed toolchain components' tarballs: done in 1.08s (at 00:20)
[INFO ] =================================================================
[INFO ] Extracting and patching toolchain components
[INFO ] Extracting and patching toolchain components: done in 5.23s (at 00:25)
[INFO ] =================================================================
[INFO ] Installing kernel headers
[INFO ] Installing kernel headers: done in 34.50s (at 01:00)
[INFO ] =================================================================
[INFO ] Installing GMP
[INFO ] Installing GMP: done in 818.31s (at 14:39)
[INFO ] =================================================================
[INFO ] Installing MPFR
[INFO ] Installing MPFR: done in 114.82s (at 16:34)
[INFO ] =================================================================
[INFO ] Installing PPL
[INFO ] Installing PPL: done in 430.07s (at 23:44)
[INFO ] =================================================================
[INFO ] Installing CLooG/ppl
[INFO ] Installing CLooG/ppl: done in 40.21s (at 24:24)
[INFO ] =================================================================
[INFO ] Installing MPC
[INFO ] Installing MPC: done in 48.70s (at 25:13)
[INFO ] =================================================================
[INFO ] Installing libelf
[INFO ] Installing libelf: done in 21.35s (at 25:35)
[INFO ] =================================================================
[INFO ] Installing binutils
[INFO ] Installing binutils: done in 406.44s (at 32:21)
[INFO ] =================================================================
[INFO ] Installing static core C compiler
[INFO ] Installing static core C compiler: done in 565.23s (at 41:47)
[INFO ] =================================================================
[INFO ] Installing C library headers
[INFO ] Installing C library headers: done in 153.94s (at 44:21)
[INFO ] =================================================================
[INFO ] Installing C library start files
[WARN ] Removing "-pipe" for use with glibc>=2.6
[INFO ] Installing C library start files: done in 130.95s (at 46:32)
[INFO ] =================================================================
[INFO ] Installing shared core C compiler
[INFO ] Installing shared core C compiler: done in 638.93s (at 57:11)
[INFO ] =================================================================
[INFO ] Installing C library
[WARN ] Removing "-pipe" for use with glibc>=2.6
[INFO ] Installing C library: done in 2468.27s (at 98:19)
[INFO ] =================================================================
[INFO ] Installing final compiler
[INFO ] Installing final compiler: done in 1453.91s (at 122:33)
[INFO ] =================================================================
[INFO ] Installing libelf for the target
[INFO ] Installing libelf for the target: done in 42.04s (at 123:16)
[INFO ] =================================================================
[INFO ] Installing dmalloc
[INFO ] Installing dmalloc: done in 76.23s (at 124:32)
[INFO ] =================================================================
[INFO ] Installing D.U.M.A.
[INFO ] Installing D.U.M.A.: done in 6.90s (at 124:39)
[INFO ] =================================================================
[INFO ] Installing cross-gdb
[INFO ] Installing cross-gdb: done in 686.93s (at 136:06)
[INFO ] =================================================================
[INFO ] Installing gdbserver
[INFO ] Installing gdbserver: done in 55.26s (at 137:02)
[INFO ] =================================================================
[INFO ] Installing ltrace
[INFO ] Installing ltrace: done in 11.29s (at 137:13)
[INFO ] =================================================================
[INFO ] Installing strace
[INFO ] Installing strace: done in 61.61s (at 138:15)
[INFO ] =================================================================
[INFO ] Cleaning-up the toolchain's directory
[INFO ] Stripping all toolchain executables
[INFO ] Cleaning-up the toolchain's directory: done in 14.60s (at 138:30)
[INFO ] Build completed at 20101210.150051
[INFO ] (elapsed: 138:27.51)
[INFO ] Finishing installation (may take a few seconds)...
No comments:
Post a Comment