Chapter 7Cross-Compilation and the Eclipse IDE

To this point in the book, all the code is built and executed directly on the RPi. However, for larger projects this can be impractical, because you may need to manage many source files within a single project. In addition, compilation times can be slow on the RPi for building large projects. This chapter first describes how you can use your desktop computer to develop applications that can be deployed directly to the RPi. The Eclipse integrated development environment (IDE) is then introduced, which allows for advanced development capabilities, such as remote debugging. The chapter finishes by outlining how you can build and deploy a custom Linux kernel for the RPi platform.

Equipment Required for This Chapter:
  • A Linux (ideally Debian 8+) standalone or virtual machine (VM) desktop instance (see Chapter 3)
  • Any RPi board for deployment and debugging

Further details on this chapter are available at www.exploringrpi.com/chapter7/.

Setting Up a Cross-Compilation Toolchain

This section describes how you can establish a full-featured cross-compilation environment for building code for the RPi using your desktop computer. A typical C/C++ compiler that is executed on a desktop computer (e.g., Intel x86) will build executable machine code for that platform only. Therefore, a cross-compiler is required, because it is capable of creating executable code for the RPi ARM platform directly from your desktop computer, even though it has a ...

Get Exploring Raspberry Pi now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.