Notes about building a toolchain for the iliad using crosstool

From MobileRead
Jump to: navigation, search

NOTE: Unfinished instructions. That may change :-).

The following instructions were tested in a Debian Sarge system, with scratchbox installed as per Iliad unofficial toolchain page. It's based on [this post]

Contents

[edit] Compiling the crosscompiler and libraries (for GCC3.4.2 and GLIBC2.3.3)

First add a user in your box:

# adduser iliad29

Then su to the new user

# su iliad29

Get the last crosstool and iliad files

$ mkdir crosstool
$ cd crosstool
$ wget crosstool-0.43.tar.gz
$ wget -O crosstool-iliad-files.tar.gz "http://www.mobileread.com/forums/attachment.php?attachmentid=1312"

Uncompress crosstool and the iliad crosstool files

$ tar -xvzf crosstool-0.43.tar.gz
$ tar -xvzf crosstool-iliad-files.tar.gz

Move the iliad crosstool files to the appropiate places (yes, actually I should prepare a new tgz, but until then...)

$ mv crosstool/gcc-3.4.2/patches/fix-fixincl-3.4.2.patch crosstool-0.43/patches/gcc-3.4.2/
$ mv crosstool/linux-2.4.19/patches/* crosstool-0.43/patches/linux-2.4.19/
$ mv crosstool/*.sh crosstool-0.43/
$ rm -r crosstool

Put the real irex patch to the kernel

$ wget http://developer.irexnet.com/pub/Linux%20kernel/linux-2.4.19-rmk7-pxa2-irex1.patch.gz
$ gunzip linux-2.4.19-rmk7-pxa2-irex1.patch.gz
$ mv linux-2.4.19-rmk7-pxa2-irex1.patch crosstool-0.43/patches/linux-2.4.19/03-diff-2.4.19-rmk7-pxa2-irex1.patch

Put the script with the build configuration

$ cd crosstool-0.43/
$ wget -O demo-iliad-softfloat-29.sh "http://www.mobileread.com/forums/attachment.php?attachmentid=2952"

In the above downloaded script , there is a line:

eval `cat arm-softfloat.dat gcc-3.4.4-glibc-2.3.3.dat` LINUX_DIR=linux-2.4.19 sh all.sh --notest

change to:

eval `cat arm-softfloat.dat gcc-3.4.2-glibc-2.3.3.dat` LINUX_DIR=linux-2.4.19 sh all.sh --notest

Compile (this step requires some gigabytes and some hours of patience)

$ su
# mkdir /scratchbox/compilers/arm-linux-iliad-softfloat-29
# chmod 755 /scratchbox/compilers/arm-linux-iliad-softfloat-29
# chown iliad29 /scratchbox/compilers/arm-linux-iliad-softfloat-29
# exit
$ . prepare.sh
$ sh demo-iliad-softfloat-29.sh

[edit] Compiling the crosscompiler and libraries (for GCC3.4.4 and GLIBC2.3.4)

Based on the above steps, only several minor variations.

1. Skip the step downloading "crosstool-iliad-files.tar.gz". The patch provided by crosstool0.43 is enough.

2. In the above downloaded script (demo-iliad-softfloat-29.sh), there is a line:

eval `cat arm-softfloat.dat gcc-3.4.4-glibc-2.3.3.dat` LINUX_DIR=linux-2.4.19 sh all.sh --notest change to:

eval `cat arm-softfloat.dat gcc-3.4.4-glibc-2.3.4.dat` LINUX_DIR=linux-2.4.19 sh all.sh --notest

3. Optional: use kernel source and patch from iRex.

  • crosstool will download selected gcc, glibc and kernel source in ~/crosstool. We can replace the original kernel source with the patched kernel source from iRex.
  • Download:

The full iLiad (ER0100) Linux kernel: 2.4.19-rmk7-pxa2-irex1 (http://developer.irexnet.com/pub/iLiad/Linux%20kernel/linux-2.4.19-rmk7-pxa2-irex1.tar.bz2)

Patch file for changes in v2.11 release (http://developer.irexnet.com/pub/iLiad/Linux%20kernel/linux-2.4.19-rmk7-pxa2-irex1-v2.11.patch)

  • Unpack and apply patch. Rename it to linux-2.4.19 and repack. Put it in ~/crosstool. Then execute demo-iliad-softfloat-29.sh.

[edit] Integration toolchain with scratchbox

See this webpage (http://www.scratchbox.org/wiki/ForeignToolchains)

1. Login to scratchbox and create a host target in advance.

2. In the host target environment, create other cross-build environment as prescribed in the above webpage.

3. Re-enter "sb-menu", one can create new target with cross-build toolchain now.

4. Official SDK can integrate with scratchbox with similiar steps.

[edit] Creation of the debian packages

(TBD)

Personal tools
Namespaces

Variants
Actions
Navigation
MobileRead Networks
Toolbox