RTEMS Logo

RTEMS 4.9.6 On-Line Library


Building GCC with Ada Support

PREV UP NEXT Bookshelf Getting Started with RTEMS

4.2.8: Building GCC with Ada Support

If you want a GCC toolset that includes support for Ada (e.g. GNAT), there are some additional requirements on the host environment and additional build steps to perform. It is critical that you use the same version of GCC/GNAT as the native compiler. GNAT must be compiled with an Ada compiler and when building a GNAT cross-compiler, it should be the same version of GNAT itself.

It is also important to verify whether there is an RTEMS specific Ada patch required for GCC. These can be found in http://www.rtems.org/ftp/pub/rtems/people/joel/ada. The patch is often a minor version or two behind GCC but will usually apply cleanly. This patch must be applied.

After this, it is critical to perform these steps in the correct order. GNAT requires that the C Library and RTEMS itself be installed before the language run-time can be built.

The build procedure is the same until the Ada configure step. A GCC toolset with GNAT enabled requires that ada be included in the set of enabled languages. The following example illustrates the invocation of configure and make to build and install gcc-<VERSION> with only C, C++, and Ada support for the sparc-rtems4.9 target:

mkdir b-gcc
cd b-gcc
../gcc-<VERSION>/configure --target=sparc-rtems4.9 \
   --with-gnu-as --with-gnu-ld --with-newlib --verbose \
   --enable-threads --enable-languages="c,c++,ada" \
   --prefix=/opt/rtems-4.9
make all
make info
make install

After gcc-<VERSION> is built and installed the build directory b-gcc may be removed.


PREV UP NEXT Bookshelf Getting Started with RTEMS

Copyright © 1988-2008 OAR Corporation