I wanted to build a cross toolchain so I could more easily develop for my RPi on my normal development machine. I also fancy setting up a dist-cc compile farm, but my programs are certainly too small to benefit from this!
Although as a general rule I prefer Ubuntu, I have Fedora on my netbook. This may have made things more difficult to begin with, since the RPi wiki has simple-sounding instructions for installing the arm-unknown-linux-gnueabi toolchain on various distros, except Fedora. No panic, there was a similarly-named arm toolchain package, so I installed that and set about compiling and transferring my take on "hello, world". Unfortunately, when I tried to run it, all I got was "file not found". Hmm, something's not right.
Since the toolchain name didn't quite match what I wanted anyway I didn't bother apt-get installing gdb to investigate, rather I went to another tool that I'd seen mentioned: Sourcery CodeBench lite. This download ok (after being sent an incorrect link) and after installing I was a bit baffled how to build (or, more to the point, link) anything at all!
Maybe I should have spent more time trying to understand the documentation, but it sounded very low-level and it wasn't clear what the right selections were for the RPi.
Next up was crosstool-ng, a script that is meant to simplify building and configuring cross-toolchains. I'm sure I've used its predecessor, crosstool, before, so I downloaded and installed it. This time, however, I was using my wife's win2k3 machine (I'm sure she'd like me to point out that this also runs Ubuntu, but she's using some silly Windows-only application at the moment). This meant an error during the initial install, due to some cygwin incompatibility. Once that was resolved, I went through the menuconfig screens, taking defaults and random guesses until it was ready to build. It didn't take long for this to fail: during the initial sanity checks, it noticed that my filesystem was case-insensitive and that was that.
All was not lost, though. Crosstool-ng had given me a hint about what was needed for a cross-toolchain so I downloaded the source for the C libraries installed on the Raspberry Pi. Since this was a debian distro, this was just a case of:
apt-get source glibc
This had a friendly-looking readme file concerning cross compilation. With this I've had much more luck; I still haven't built my hello world program yet, but it's nearly there. I'll share my experiences with this in a subsequent post, so stay tuned!
No comments:
Post a Comment