Thursday, January 3, 2013

Raspberry Pi cross-compiler

If you have a raspberry pi, you might want to build your own cross-compiler, because compiling on the pi is not very fast and if you have a template heavy library, compiling might exceed the pi's memory capacities. As that happened to me, I decided to build a toolchain using crosstools-ng on linux mint 12.
I stuck to these instructions that I found on google. However, whatever combination of gcc, target linux kernel and binutils version I chose, building the chain failed when building binutils.
I tried to build binutils on my and even then it failed. So I got rather frustrated, but after some search on the web, I came across a solution. It's as simple as that:
If your C_INCLUDE_PATH ends with a trailing colon, just remove that colon. After doing that I did not have any trouble compiling binutils, both on my own as well as part of the toolchain.

More detailed instructinos can be found on this blog.
I tested the toolchain and I was able to compile Hello World for my raspberry pi. So now is the time to have a look at more sophisticated stuff.

No comments:

Post a Comment