Hardware Reference
In-Depth Information
Figure 6-21. The optimized crosstool-NG build
I like to move my old tool chain to a backup location before I make the new one. I will just rename the
arm-unknown-linux-gnueabi directory under the x-tools directory to arm-unknown-linux-gnueabi.old . Once that's
done, it's time to build the tool chain again. When this is done you must recompile your applications that you have
already compiled for the new tool chain. Always keep in mind when optimizing the tool chain that there is a lot of
potential for things to bake even the same application but a newer or older version may not compile the same way.
Reading the manuals and understanding the features is key.
Summary
This chapter has focused heavily on tools that do not directly run on the Raspberry Pi. I have done my best to make
this as distribution-free as possible. The steps and tools have all been built from sources using only your distributions
and GCC to bootstrap the initial process. You started this chapter by reading about what a cross compile environment
is. After all, you may not have a lot of different types of architectures. I hope by reading this that you have found a need
or a good reason to consider using a cross compiler. After discovering what a cross compiler can do, I talked about
GCC and its many roles in the cross compiling environment. Next up, I introduced you to one of my favorite tools:
crosstool-NG. Many years ago I used to do the two stages (GCC and dependency build) by hand; back then it was for
a MIPS 64-bit architecture and not an ARM architecture. This process was painful and getting to a working tool-chain
stage took weeks of work (and many errors, a lot of foul language, and many beers).
None of that happens anymore; as you saw from the friendly menus in crosstool-NG, you can manage to get a
tool-chain build done very quickly and with little pain. Once you had built a very basic tool chain for the Raspberry
Pi, the next task was to cross compile your first application. After that I showed you how to build an application with
no external dependencies. Lastly I demonstrated how to build a simple application with one dependent application.
These steps are building blocks for all cross compiling. It's just a matter of using configure flags and dependencies
from now on. Dependencies will become a lot harder to manage with bigger projects. Lastly I showed you some
settings for optimizing the build. More important, I showed you how you can use the hardware's white papers and the
GCC manuals to understand what the GCC is going to do.
 
Search WWH ::




Custom Search