Building the PowerPC development tools for Linux
IntroductioneCos requires powerpc-eabi development tools to develop programs for PowerPC targets. The development tools come in three parts: the GNU compiler collection (GCC), the GNU Debugger (GDB) and the GNU binary utilities, which include the GNU assembler and linker. This page details the steps required to download and build these development tools.
Downloading the tool sources
GNU Binary Utilities
It is recommended that eCos is used with the most recent official release of the GNU Binary Utilities (binutils), currently version 2.10.1. This is available from the binutils area of the main GNU software download site or any of its mirror sites. It is also available at any of the mirror sites for sources.redhat.com. Download sizes are in the region of 5.5MB for .bz2 format archives, or 7MB for .gz format archives.
Weekly and daily snapshots from the CVS repository are also available from the main binutils development site, but these have not been verified for use with eCos.
If you already have binutils sources available but are unsure of their version, you can search the file gas/configure for the string "VERSION" and examine its value.
GNU Compiler CollectionThe GNU Compiler Collection web site contains plenty of information about installing and using GCC. A snapshot of the GCC development sources may be used to obtain the most up-to-date compiler with new features and bug fixes. However, it is recommended that the most recent official release (GCC 2.95.2) is used, as it is likely to be more stable.
GCC 2.95.2 sources can be downloaded from the releases page. Both the core distribution and the C++ distribution files are required for eCos. Alternatively, click on the appropriate following links to download the files directly:
It is strongly recommended you use a mirror site close to you, which will result in a faster download, reduced internet congestion, and reduced load on the central server.
Instructions for downloading the GNU Debugger (GDB) are provided on the GDB home page. However, Red Hat has also released an open source graphical front-end to GDB based on Tcl/Tk called Insight, which has a separate home page.
The Insight sources are a superset of the standard GDB sources. It is also still possible to run GDB in command-line mode by using the -nw command-line option when invoking GDB, so there is nothing to lose by using the Insight sources.
The latest release (version 5.0) is recommended and may be downloaded via the GDB home page. Alternatively, click on on one of following links to download the files directly:
Preparing the sources for buildingOnce the tools sources have been downloaded, they must be prepared before building. These instructions assume that the tool sources will be extracted in the /src directory hierarchy. Other locations may be substituted throughout. Similarly placeholders of the form YYYYMMDD and YYMMDD should be replaced with the actual date of the downloaded files. Ensure that the file system used has sufficient free space available. The contents of each archive will expand to occupy approximately 6 times the space required by the compressed archive itself. To extract the downloaded sources, you will need to have either the bzip2 or gzip compression utilities, depending on your choice of download format. A patch utility (preferably GNU patch) is also required.
The following steps should be followed at a sh, ksh or bash prompt. Users of the csh and tcsh shells should replace 2>&1 with |& throughout:
Building the toolsBefore attempting to build the tools, ensure that the GNU native compiler tools directory is on the PATH and precedes the current directory. The following build procedures will fail if . is ahead of the native tools in the PATH.
Approximate disk space requirements for building the development tools are as follows:
Following successful building and installation of each set of tools, the associated build tree may be deleted to save space if necessary. These instructions assume that the tools will be built in the /tmp/build directory hierarchy and installed to /tools. Other locations may be substituted throughout:
TroubleshootingIf you encounter difficulties in building or using the development tools, first check the eCos FAQ and the ecos-discuss mailing list archive to see if the topic has come up before. Initial queries may be directed to the ecos-discuss list. However, there are other mailing lists which may be more appropriate if a problem is clearly related to a particular tool: