I’m just getting into cross-compiling with GCC for various other bits of hardware. In the end, it is quite simple to do.
The first thing to do is download the crosstools bundle and unpack it (making sure you are not logged in as root!).
Then you need to create /opt/crosstool directory, and make sure it is owned by the mortal user that will do the building.
Then it is a matter of:
RESULT_TOP=/opt/crosstool
export RESULT_TOP
eval `cat file.dat file.dat` sh all.sh –notest
The file.dats depend on the target hardware:
Reciva Internet Radio: arm9tdmi.dat gcc-3.3.4-glibc-2.3.2.dat
Dreambox: mipsel gcc-3.3.4-glibc-2.3.3.dat
Freecom Network Storage Box: (possibly) armv5b-softfloat.dat gcc-3.4.5-glibc-2.3.6.dat
Netgear ADSL Modem:
By default, the crosstools compilers install in /opt/crosstool - add the following lines to your .bashrc
COMPILERS=`echo /opt/crosstool/*/*/bin | sed -e ’s/ /:/g’`
PATH=$PATH:$COMPILERS
And then when compiling, have the following in your Makefiles
CROSS:=arm-unknown-linux-gnu-
CC:=($CROSS)gcc
LD:=($CROSS)gcc
If you want to use a different compiler, you can always use:
make CROSS=arm-9dtmi-linux-gnu-
… for example !
0 comments:
Post a Comment