Skip to main content.

5. Compiler Toolset

You'll need the GNU toolchain to compile the kernel, particularly gcc and binutils. As a general rule for working with GNU software, the latest official release is the best supported, has the most features and is usually the most stable. Also, you must use compatible versions, and there is generally no easy way to know which binutils version matches which arbitrary gcc version as their releases aren't synchronised. Hence, the best approach is generally to start by using the latest official release of any given package from your nearest GNU ftp site listed at http://www.gnu.org/order/ftp.html.

Many people use a particular version simply because they already have the source for it lying around, and waste a lot of time tracking down problems that were fixed by others months or even years ago. Grab the latest version at the outset, and you'll save an enormous amount of effort.

If you need newer features that are not in an official release yet, you may need to move forward to the latest development snapshot from http://sources.redhat.com/.

5.1. Building the toolchain

5.1.1. Instructions

A set of complete instructions for building a Cross Development system for Linux/PPC is available at: http://members.home.net/mmporter/linux/cross/

5.1.2. Build Scripts

For pre-packaged scripts to build a PPC Cross Development Kit for MPC8xx, see: ftp://ftp.denx.de/pub/LinuxPPC/usr/src/CD-README and ftp://ftp.denx.de/pub/LinuxPPC/usr/src/CDK.tar.gz.

5.1.3. SPARC/Solaris Hosted

For a guide to building the PowerPC/Linux cross compiler for a SPARC/Solaris host (if you can't use a Linux development host), see: http://www.borg.umn.edu/~grant/Linux/cross.html

5.1.4. Getting Help

If you want to build a more exotic or unusual cross development environment, or need more help building the cross development tools, check out the crossgcc FAQ and mailing list at: http://www.objsw.com/CrossGCC/

5.2. gcc

Check that you have the latest gcc (2.95.2). Don't waste your time with any of the egcs releases as they've now been superseded by gcc.

If you're using gcc-2.95.2 with binutils-2.9.1.0.25, you'll need a minor change to the gcc specs file regarding the linker emulation. You're better off just using binutils-2.10 though.

5.3. binutils

There are currently two branches of binutils development to choose from. Each have pro's and con's, and in many cases either one will work for you. They are typically referred to as the official "GNU binutils" and the "Linux binutils," although both are GPL'd GNU software, and both versions configure, build, and work fine on Linux. I suggest you use the official GNU version, unless you encounter a problem which requires the "Linux binutils" version.

5.3.1. Official GNU binutils

This tends to be the most stable version. The last release was 2.10, which is your best bet. It works well with gcc-2.95.2, whereas the 2.9.1 needed a tweak. If you must use the bleeding edge, the development snapshots on http://sources.redhat.com/ are quite stable.

The most recent snapshot is available at ftp://sources.redhat.com/pub/binutils/snapshots/binutils.tar.bz

5.3.2. H. J. Lu's "Linux binutils"

At any given point in time, this version is based on recent official GNU development snapshot, but with more experimental features and hastily implemented bugfixes. It is shipped with many Linux distributions. However, the changes in this version aren't as thoroughly reviewed and tested as those in the official version, and the less well-implemented features probably won't make it back into the official GNU version, so it's a good idea not to rely on them.

Version numbering is somewhat confusing. The Linux binutils 2.9.5.x versions are based on snapshots of the official development post 2.9.1. In particular, any given version of Linux binutils numbered 2.9.5.x is not necessarily a later version than an official GNU development snapshot numbered 2.9.1.x.

Beware that Linux binutils-2.9.5.0.27 thru 29 will give you multiple definitions of when building glibc-2.1.2. Try the official binutils-2.10 instead, or Linux binutils-2.9.5.0.22.

5.4. Precompiled/Prepackaged Kits

There are kits available which will save you the time of building your own tools, to get bootstrapped faster.

5.4.1. MontaVista? Software Hard Hat Linux

http://www.mvista.com/

http://www.hardhatlinux.com/

They have a complete 8xx cross-development kit described in ftp://ftp.mvista.com/pub/CDKit/1.2/README available at: ftp://ftp.mvista.com/pub/CDKit/1.2/

You can also purchase this kit as an integrated part of their Hard Hat Linux distribution and buy support for it directly from MontaVista?.

It's also available as part of the LinuxPlanet kit from Embedded Planet.

5.4.2. QuickStack? Linux

http://qslinux.com/

ftp://qslinux.com/pub/qslinux

This version of Linux is based on the PPC 2.2.5 kernel. It has been heavily modified and targeted specifically to SNMC's MPC850-based product. It includes:

5.4.3. Denx Software Engineering

http://www.denx.de/solutions-en.html

5.4.3.1. ftp site

ftp://ftp.denx.de/pub/LinuxPPC/usr/src/

5.4.3.2. CD-ROMs

Offer a CD-ROM with LinuxPPC? for MPC8xx Systems, especially for TQM8xxL Modules. It includes:

5.4.3.3. Boards

They also ship hardware with PPCBoot, kernel, and root file system pre-installed. Just connect the power supply, and Linux is booting.

5.4.4. The Embedded Debian Project

http://www.emdebian.org/

Debian project philosophy applied to the embedded space. Especially good for developers already running Debian on the desktop.

5.4.5. Bright Star Engineering

http://www.brightstareng.com

You may get a kickstart by purchasing Bright Star's SDK, particularly if you're using one of their boards. For comments, see: http://lists.linuxppc.org/listarcs/linuxppc-embedded/199912/msg00075.html

5.4.6. Lineo Embedix

http://www.lineo.com/

Lineo Embedix Linux is an embedded Linux-based software solution that adds the power and connectivity of Linux to customized embedded devices. Embedix Linux is engineered specifically for the unique speed, memory and storage requirements of embedded devices.

Lineo provides embedded development kits for several PPC processors and boards. Additional information can be found at:

and [[http://www.lineo.com/products/embedix_sdk/datasheet.html

5.4.7. Red Hat Embedded DevKit?

http://www.it.redhat.com/products/embedded/ename=Kernel,dk/

Gets you started with embedded Linux development using Red Hat Linux. The box product includes a complete toolkit with IDE and ethernet-based debugging and supports development of PowerPC architecture systems, along with the x86 architecture.

Oddly enough, the minimum target CPU required by the x86 binaries in the kit is a Pentium/586, whereas the minimum desktop CPU for Red Hat Linux is only a 386. Embedded systems most often have less powerful CPUs than desktop ones, not more powerfuld ones. This mistake doesn't affect PowerPC users at all, but you might want to consider whether this supplier is the best choice given such a fundamental error.

4. Host Development Platform 1. Introduction 6. Programming the Target
Prev Home Next