Order it now! Amazon prioritizes orders on a first come, first served basis.


View Full Version : Howto create a crosscompiler for iliad27 using softfloat, with scratchbox integration


Antartica
10-25-2006, 01:10 PM
Hi all!

My first attempt to do a crosscompiler (this thread: http://www.mobileread.com/forums/showthread.php?t=7077) had an error, in that it created it with hardware floating point support, while the iliad uses softfloat. Here are the instructions to create it for softfloat support (bonus: I've also documented the integration with scratchbox (see this other thread: http://www.mobileread.com/forums/showthread.php?t=7131, so you can compile programs for the iliad as if using a native compiler, so most of autoconf-based programs compile flawlessly).

Here it is:

How to install a crosscompiler with softfloat support and integrated with scratchbox

# adduser iliad27
# sudo sb-adduser iliad27
# su - iliad27
$ wget -O crosstool-iliad-files.tar.gz "http://www.mobileread.com/forums/attachment.php?attachmentid=1312"
$ tar -xvzf crosstool-iliad-files.tar.gz
$ wget -O demo-iliad-softfloat.sh.txt "http://www.mobileread.com/forums/attachment.php?attachmentid=1986"
$ cd crosstool
$ wget http://www.kegel.com/crosstool/crosstool-0.42.tar.gz
$ tar -xvzf crosstool-0.42.tar.gz
$ cd ~/crosstool/crosstool-0.42/
$ cp ../../demo-iliad-softfloat.sh.txt demo-iliad-softfloat.sh
$ chmod a+x demo-iliad-softfloat.sh
$ . ../prepare.sh
$ sudo mkdir /scratchbox/compilers/arm-linux-iliad-softfloat
$ sudo chown iliad27:iliad27 /scratchbox/compilers/arm-linux-iliad-softfloat
$ ./demo-iliad-softfloat.sh
(Wait a lot of time while the toolchain builds)
(That's all, you should have your new toolchain in the specified RESULT_TOP, that is, /scratchbox/compilers/arm-linux-iliad-softfloat directory.)


Integration with scratchbox

$ cd /scratchbox/compilers/arm-linux-iliad-softfloat
$ ln -s gcc-3.4.2-glibc-2.3.3/arm-softfloat-linux-gnu/* .
$ cd /scratchbox/compilers/arm-linux-iliad
$ ~/sb-toolchain-extras/confhelper/create_toolchain_conf.py > ~/sb-toolchain-extras/meta/alien-tc/arm-iliad.conf
$ cd ~
$ darcs get --set-scripts-executable http://scratchbox.org/repos/1.0/sb-toolchain-extras
(alternatively, if you don't have dracs installed, you can untar the attached file)
$ cd /scratchbox/compilers/arm-linux-iliad-softfloat
$ ~/sb-toolchain-extras/confhelper/create_toolchain_conf.py > ~/sb-toolchain-extras/meta/alien-tc/arm-iliad-softfloat.conf
$ cd ~/sb-toolchain-extras
$ make CONFIG=meta/alien-tc/arm-iliad-softfloat.conf -C meta/alien-tc all-sums
$ make CONFIG=meta/alien-tc/arm-iliad-softfloat.conf -C meta/alien-tc
$ find . -name configure -exec chmod a+x \{\} \;
$ cd /scratchbox/compilers/arm-linux-iliad/arm-softfloat-linux-gnu/bin
$ for i in * ; do ln -s $i sbox-$i ; done

Configuration of the user to use the new crosscompiler

$ sb-menu
(new target, select the new toolchain, select qemu-arm/perl/debian, don't unpack filesystem, install all utilities and select the new target as default)

Enter scratchbox

$ scratchbox

Miscellaneous

I've untarred the filesystem.27.tar.gz in /iliad in the scratchbox setup, and also done
sbox$ cd /usr/lib
sbox$ ln -s /iliad/usr/lib/* .

For the header files... untar the attached src-xdevel.tar.gz file (files taken shamelessly from debian arm packages...). I've untarred it in /home/iliad27/ , and then
$ cd /usr/include
$ ln -s /home/iliad27/src.xdevel/usr/X11R6/include/X11 .

And I've tested it compiling tcltk 8.5a4; it compiles flawlessly :-). In the previous attempt, tk wouldn't compile...

Have fun! :cool:

scotty1024
10-25-2006, 11:12 PM
Whoosh, still trying to build this monster. I'd never heard of scratchbox before, looks pretty cool.

By the way, from my sniffing around it looks like iRex is using: http://www.openembedded.org/wiki/GettingStarted

scotty1024
10-26-2006, 06:42 AM
So far the test compile in ./demo-iliad-softfloat.sh is failing with an undefined path max size.

I pulled and installed a debian 3.1r3. Did I grab the wrong OS version?

Antartica
10-26-2006, 07:04 AM
By the way, from my sniffing around it looks like iRex is using: http://www.openembedded.org/wiki/GettingStarted

We were supposing that is was some sort of openembedded based distro since 2.4 :-) (see http://www.mobileread.com/forums/showpost.php?p=32743&postcount=202).

Now you have confirmed it :-b

Antartica
10-26-2006, 07:09 AM
So far the test compile in ./demo-iliad-softfloat.sh is failing with an undefined path max size.

I pulled and installed a debian 3.1r3. Did I grab the wrong OS version?

I've tested it with "3.1r0", I'm sure r3 works. IIRC that happens if you don't source the prepare.sh (i.e. if you miss the first point). it is:
. ../prepare.sh
that is:
point space point point slash prepare.sh

is it working with this?

scotty1024
10-26-2006, 07:14 AM
I've tested it with "3.1r0", I'm sure r3 works. IIRC that happens if you don't source the prepare.sh (i.e. if you miss the first point). it is:
. ../prepare.sh
that is:
point space point point slash prepare.sh

is it working with this?

Ooops, had to reboot a couple times, forgot to re-source my shell, sigh... :rolleyes5

Thanks, I'll give 'er another go.

Matthijs
10-26-2006, 08:15 AM
It should be possible to integrate scratchbox into the official iRex crosscompiler-toolchain (http://www.mobileread.com/forums/showthread.php?t=8259) also.
See http://dominion.kabel.utwente.nl/koen/cms/using-openembedded-toolchains-in-scratchbox for details.

scotty1024
10-26-2006, 10:16 AM
@Antartica

Your toolchain does have one advantage: source.