Hardware Reference
In-Depth Information
So before you decide that you want to build a cross-compiler environment, are you
prepared to
Provide all matching C/C++ header files from the ARM platform?
Provide all ARM libraries needed, including libraries for
third-party products like sqlite3 that you intend to link with?
Provide sufficient disk space for the cross-compiler and tools?
The crosstool-NG software will mitigate some of these issues. For example, the
correct Linux headers are chosen by the configuration step shown later in this chapter.
Disk space solves many issues by holding a copy of your Raspberry Pi's root file
system on your build platform. Simple programs won't require this (for example, a Hello
World). But software linking to libraries may require this. Even if you're strapped for
disk space, you may be able to mount the Raspbian SD card on the build platform, thus
gaining access to the Raspberry Pi's root file system.
Operating System
The procedure used for building a cross-compiler environment is somewhat complex
and fragile. Using the crosstool-NG software simplifies things considerably. Despite this
advantage, it is best to stick with proven cross-compiler platforms and configurations.
You might be tempted to say, “The source code is open, and so it should work on
just about any operating system.” (You might even say, “I'll fix the problems myself.”)
The reality is not quite so simple. I use the Mac Ports collection ( www.macports.org ) for
a number of things and quickly discovered the limitations of building a crosstool-NG
on Mac OS X. For example, I found that objcopy was not supported when ./configure
was run for the cross-compiler. Unless you are willing to spend time on Internet forums
and wait for answers, I suggest you take a more pragmatic approach—build your cross-
compiling environment on a recent and stable Ubuntu or Debian environment.
This chapter uses Ubuntu 14.04 LTS hosted in VirtualBox 4.3.12 ( www.virtualbox.org )
on a Mac OS X Mavericks MacBook Pro, running an Intel i7 processor. Current versions of
Ubuntu are recommended. Ubuntu 12.10 was the version tested and used by the process
documented at this link:
www.kitware.com/blog/home/post/426
Host, Guest, Build, and Target
At this point, a short note is in order because these terms can get confusing, especially
for those performing this for the first time. Let's list the environment terms, which will be
referred to throughout the remainder of this chapter:
Host environment
Guest environment
Build/local environment
Target environment
 
Search WWH ::




Custom Search