Specialized Cross Compiler

From Omnifi Wiki

Jump to: navigation, search
Quick Links
Related topics
  • Find Something
    • To Put Here

edit

There may be a need (there has been, actually) where you might want to build kernel modules for the DMP1. In order for this to work correctly, you'd need a Compiler and Kernel that most closely resembles the one used in the DMP1/DMS1. In our case gcc-2.95.3 and linux-2.4.18-rmk7. This means that you just can't use the "regular ol'" crosstool compiler to build these modules (the standard build uses gcc-3.4.1 and linux 2.6.8).

Alternately, you might be wanting to write programs that you can dynamically link with the shared object libraries that already exist on the DMP1/DMS1. The DMP1/DMS1 uses uClibc 0.9.15. Again, this means that the "regular ol'" crosstool compiler cannot do that--wrong gcc version, wrong linux version, wrong libc (crosstool uses gblic-2.3.3, we need uClibc 0.9.15).

This is the primary reason why when we compile programs using crosstool (such as openfi), we specify the -static -Os option on the gcc line. The -static flag causes the gcc compiler to include all of the library code necessary to run this program. That is, a simple "Hello World." progam may end up to be several hundred thousand bytes because we're including all of the libraries needed to display an output to the screen, among other control options.

Contents

[edit] Simple Documented Steps

lincomatic to openfi_dev 10/15/05

With lots of help from Dan, here's the procedure I used for building a crosstools suitable for building openfi drivers:

1. get the latest crosstools and extract it.

2. edit demo-arm-softfloat.sh and make this the only line that's enabled in the eval section:

eval 'cat arm-softfloat.dat gcc-2.95.3-glibc-2.2.5' sh all.sh --notest

3. edit gcc-2.95.3-gcc-2.2.5.dat and change LINUX_DIR:

 LINUX_DIR=linux-2.4.18-rmk7

4. download the 2.4.18 src & rmk7 patch and extract:

ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-2.4.18.tar.gz
ftp://ftp.arm.linux.org.uk/pub/armlinux/kernel/v2.4/patch-2.4.18-rmk7.gz

5. rename the linux dir to linux-2.4.18-rmk7, cd into it, and run:

 patch -p1 <../patch-2.4.18-rmk7

6. cd to crosstools build dir and launch demo-arm-softfloat.sh. let it run a couple of seconds, and then hit CTRL-S to stop it.

7. open up another rlogin session and move your linux-2.4.18-rmk7 to crosstoolssrcdir/build/arm-softfloat-linux-gnu/gcc-2.95.3-glibc-2.2.5/linux-2.4.18-rmk7. If the crosstoolssrcdir/build/arm-softfloat-linux-gnu/gcc-2.95.3-glibc-2.2.5/ dir hasn't been created yet, hit CTRL-Q wait a few sec, then hit CTRL-S in the other rlogin and check again.

8. go back to the other rlogin session and hit CTRL-Q to let it finish the compile


[edit] There Is A Simpler, More Automated Way

Here is a script which will do all of the above (it download all files, patch, build and install), and also compile and install the uClibc-0.9.15 library and compile a "special" gcc-2.95.3 which uses that uClibc-0.9.15 library instead of the glibc-2.3.3. You will need both root priviliges and a standard user.

Download the Zipped shell script: Image:Chain.zip

[edit] See Also

[edit] External Links


--Lumkichi 11:26, 07 Apr 2006 (CDT)