How should you install a patched toolchain for the ia32? Below we describe the installation instructions for binutils-2.16.1, gcc-4.0.2 and glibc-2.3.6.
If you are building this toolchain on a Linux box with a 2.6 kernel, you will need to download kernel headers for the installation of glibc. You can download these headers here.
- Download all necessary files to some directory (say:
/tmp
). [http://ftp.gnu.org/gnu/binutils/, http://gcc.gnu.org/mirrors.html, http://ftp.gnu.org/gnu/glibc/] - Download the binutils patch from the Diablo website to the
/tmp
directory - Extract the binutils:
cd /tmp
tar xzf binutils-2.16.1.tar.gz
ortar xjf binutils-2.16.1.tar.bz2
- Patch the binutils using the patch file from the Diablo website:
cd binutils-2.16.1 ; patch -p1 < 'patchfile'
- Create a new directory where you are going to build binutils, eg. 'binutils-build', but don't make this directory of subdirectory of binutils-2.16.1:
mkdir binutils-build
- Change to the binutils-build directory and configure the binutils:
cd binutils-build ; ../binutils-2.16.1/configure --host=i686-pc-linux-gnu --prefix=/the/path/to/install/the/toolchain/ --target=i686-pc-linux-gnu --disable-nls --disable-shared
- --disable-nls means: no native language support. This results in smaller binaries, but all diagnostic messages will be in English
- --disable-shared means: statically link the binutils programs. They will be a lot bigger, but you can move the programs around.
- --prefix will make sure the new toolchain gets installed in /the/path/to/install/the/toolchain/. Note that in this directory subdirs are created such as bin and lib.
- Now type
make
andmake install
. This will start building and installing the binutils which can take a couple of minutes - To be continued...