http://raspberrypi.org
Download the VM from russelldavis vm
Use the v.0.8 or newer (if there is one).
I am using the wheezy beta version for Raspberry Pi and need a cross compilation environment to build very large projects.
The instructions that follow describe how to build a new toolchain and to setup an additional scratchbox2 environment for wheezy and the toolchain.
Install some missing packages we will need later:
Create a directory for crosstools.
cd into the directory and unpack the downloaded file.
Create a directory for debootstrap and cd to it.
Unpack the download.
Change the permissions.
I upgraded by raspberrypi before I copied off what I needed:
When it's all finished reboot and check the raspi-config settings and enable CTRL-ALT-BACKSPACE.
Copy off the necessary include and lib folders and put them in the same place in your wheezy rootfs
Download the VM from russelldavis vm
Use the v.0.8 or newer (if there is one).
I am using the wheezy beta version for Raspberry Pi and need a cross compilation environment to build very large projects.
The instructions that follow describe how to build a new toolchain and to setup an additional scratchbox2 environment for wheezy and the toolchain.
Install some missing packages we will need later:
su apt-get install bison apt-get install flex apt-get install subversion apt-get install gperf apt-get --fix-missing install texinfo apt-get install libtool apt-get install schroot
Build a cross compiler toolchain for wheezy (gcc 4.6.x)
Download crosstool-ngCreate a directory for crosstools.
cd into the directory and unpack the downloaded file.
./configure su make install /usr/local/bin/ct-ng menuconfigThe configuration I used is:
- Paths and Misc options: Enable 'Try features marked as Experimental'
- Target Options->Target architecture: arm
- Target Options->Floating point: softfp
- Operating System->Target OS: Linux
- Operating System->Linux Kernel Version:3.3.4 (should match the kernel version if you are building a kernel or device driver).
- Binary Utilities->binutils version: 2.21.1a or latest that is not experimental
- C Compiler->Enable Show Linaro version (Experimental) option
- C Compiler->gcc version: linario-4.6.2012.04
- C Compiler->Select C++ compiler
- Companion tools->Select Build some companion tools
- Companion tools-> select all the tools
/usr/local/bin/ct-ng build
Create a new rootfs for wheezy
Download debootstrap from packages.debian.org.Create a directory for debootstrap and cd to it.
Unpack the download.
su export DEBOOTSTRAP_DIR=`pwd` ./debootstrap --verbose --include=apt --arch armel \ --foreign wheezy /home/raspberrypi/Development/wheezy \ http://ftp.at.debian.org/debian/I do not seem to be able to install the apt package. So this is just for a small base system. We will come back to this.
Change the permissions.
cd /home/raspberrypi/Development/wheezy chmod -R 777 *
Configure scratchbox to use new rootfs and compiler chain.
Change directory to wheezy.sb2-init wheezy /home/raspberrypi/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc sb2-config -d wheezyNote: we pass the path to the gcc compiler... to sb2-init
Test the setup
Test the compiler is the one you want to use:sb2 gcc -vTest the compiler works:
sb2 gcc test.cWhat test.c contains:
raspberrypi@raspberrypi-developer:~/Development$ cat test.c #includeTest the exe produced works:int main(int argc, char*argv[]) { printf("hello\n"); return 1; }
raspberrypi@raspberrypi-developer:~/Development$ sb2 ./a.out hello raspberrypi@raspberrypi-developer:~/Development$ file ./a.out ./a.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.3.4, not strippedThe ultimate test is to run this on your raspberrypi.
Update the rootfs
The rootfs is minimal you will need to copy from you raspberrypi boot card the necessary include and lib folders.I upgraded by raspberrypi before I copied off what I needed:
apt-get update apt-get upgrade apt-get --fix-missing install xorg-devYou may need to answer some questions while doing the updates.
When it's all finished reboot and check the raspi-config settings and enable CTRL-ALT-BACKSPACE.
Copy off the necessary include and lib folders and put them in the same place in your wheezy rootfs
X11
The X11 libraries are not in the usual directory. They can be found here:usr/lib/arm-linux-gnueabi4Additionally the base library names are missing so you will need to do:
ln -s libX11.so.6 libX11.so etc..
Comments
Post a Comment