describes how to get a toolchain that can directly be used to compile the kernel or additional modules for the R-Pi. In Debian, the packages can be accessed by dropping…
…to /etc/apt/sources.list (perhaps adjust the squeeze for your purposes). However, for user-space compilation things are a bit trickier, eg. you may need to have various libraries installed, and especially if you"re linking statically, those binaries must be ARM.
The following is IMO a very neat way to access the toolchain directly using emulation, but no need to start the operating system:
$ wget http://downloads.raspberrypi.o.....2-2012.zip
$ unzip debian6-17-02-2012.zip
$ sudo su
# apt-get install kpartx qemu binfmt-support qemu-user qemu-user-static
# kpartx -a debian6-17-02-2012/debian6-17-02-2012.img
# mount /dev/mapper/loop0p2 /mnt
# cp /usr/bin/qemu-arm-static /mnt/usr/bin
# cp /etc/resolv.conf /mnt/etc/resolv.conf
# mount -o bind /dev /mnt/dev
# mount -o bind /proc /mnt/proc
# mount -o bind /sys /mnt/sys
# chroot /mnt
… and use GCC, Apt, etc. directly Later you can unmount and even dd the image directly to your sd-card! Alternatively you can just copy all the partition contents to a local directory and chroot there in the same way. Remember to adjust your /etc/apt/sources.list to your nearest mirror.
# umount /mnt/dev
# umount /mnt/proc
# umount /mnt/sys
# umount /mnt
# kpartx -d debian6-17-02-2012/debian6-17-02-2012.img
Note that this way you can even compile a new R-Pi kernel or modules in the chroot, forget about all the cross compilation stuff. No need to install a cross compiler outside the chroot. However, compilation is going to be slower since the gcc needs to be emulated, but unless you're compiling something huge, it doesn't matter. Unless you have an ancient desktop.