Skip to Content
Raspberry Pi Hacks
book

Raspberry Pi Hacks

by Ruth Suehle, Tom Callaway
December 2013
Intermediate to advanced
394 pages
9h 43m
English
O'Reilly Media, Inc.
Content preview from Raspberry Pi Hacks

Chapter 2. Hacking Linux for the Raspberry Pi

While there are many available operating systems for the Raspberry Pi, the most supported one is Linux. The Raspberry Pi Foundation maintains a Linux kernel source tree with support for the Raspberry Pi hardware.

Linux is famous for its flexibility and support for a large number of devices. Whether you are just interested in learning Linux, or if you need to make some modifications in order to enable an awesome hack, this chapter will help you through the process.

Hack 21. Build a Cross-Compiler Toolchain

The Raspberry Pi is well-suited for many things, but compile speed is not one of them. To build anything of consequence from source in a reasonable amount of time, you’ll need to to use a cross-compiler running on a faster computer.

A cross-compiler is a compiler (and dependent libraries) built to run on one architecture but that generates binaries for a different architecture, usually an incompatible one. In this case, you need a cross-compiler that will allow you to build binaries optimized for the Raspberry Pi Linux environment.

Like most tasks in Linux, you can generate a cross-compiler in a few ways, but to ensure that you end up with a toolchain optimized for the best performance on the Raspberry Pi, we suggest not installing prepackaged cross-compilers that come with your Linux distribution. Instead, the following sections will walk you through the process of using crosstool-ng to build it from scratch.

Install crosstool-ng

crosstool-ng ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering the Raspberry Pi

Mastering the Raspberry Pi

Warren W. Gay
Raspberry Pi 3 Home Automation Projects

Raspberry Pi 3 Home Automation Projects

Shantanu Bhadoria, Ruben Oliva Ramos

Publisher Resources

ISBN: 9781449362737ErrataSupplemental Content