Version 42 (modified by Jcreem, on Mar 21, 2007 at 6:32:08 AM) (diff)

Added "Ada Programming" term to title so this page is properly indexed by search engines that key on tha term for programming language info


Ada Programming/ RTEMS Build Instructions

Here are the build instructions, assuming $INSTALL is the prefix for the toolchain installation and $TARGET is the target code (tested with TARGET=sparc-rtems4.7), $BSP the RTEMS BSP (tested with BSP=erc32)and that you have a recent enough c,ada native GCC in PATH (timings are given on a Pentium M 1.7 GHz SuSE 9.3 machine). Please perform each configure/make/make install in a separate empty build directory. Also set PATH=$INSTALL/bin:$PATH


Note: the original RTEMS patch for GDB doesn't work with sis when using GCC 4.0 and above, for reference it is available here: gdb-6.3-rtems-20050828.diff

Autotools (1 minute)

../autoconf-2.59/configure --prefix=$INSTALL
make install
../automake-1.9.6/configure --prefix=$INSTALL
make install

Note: please apply patches mentionned above (automake 1.8.1 patch will apply to 1.9.6).

Building binutils (3 minutes)

binutils-2.16.1.tar.bz2 (12MB)

.../binutils-2.16.1/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu  --verbose --disable-nls \
--target=$TARGET --prefix=$INSTALL
make install

Note: It is also possible to install the binutils RPMs in a non-default location using rpmpcio and mv.

newlib Setup

newlib-1.13.0.tar.gz (7.4MB)

Add newlib and libgloss links in the gcc source top level directory. Be sure to patch your newlib with the latest RTEMS newlib patch mentionned above.

cd .../gcc-src/
ln -s ../newlib-1.13.0/newlib ../newlib-1.13.0/libgloss .

First Build of non-multilib C Only (12 minutes)

.../gcc-src/configure --enable-threads=rtems  --with-gnu-as --disable-multilib \
--with-gnu-ld --with-newlib  --verbose --with-system-zlib --disable-nls \
--enable-version-specific-runtime-libs \
--enable-languages=c --target=$TARGET --prefix=$INSTALL
make install

Build of non-multilib C and Ada (21 minutes)

.../gcc-src/configure --enable-threads=rtems  --with-gnu-as --disable-multilib \
--with-gnu-ld --with-newlib  --verbose --with-system-zlib --disable-nls \
--enable-version-specific-runtime-libs \
--enable-languages=c,ada --target=$TARGET --prefix=$INSTALL
make install

Or Slower Build of multilibed C, C++, and Ada (XX minutes)

Note: untested

.../gcc-src/configure --enable-threads=rtems  --with-gnu-as \
--with-gnu-ld --with-newlib  --verbose --with-system-zlib --disable-nls \
--enable-version-specific-runtime-libs \
--enable-languages=c,c++,ada --target=$TARGET --prefix=$INSTALL
make install

Build RTEMS from CVS (4 minutes)

cvs -z3 -d login
cvs -z3 -d co rtems
cd rtems
cd .../build
.../rtems/configure --disable-multilib --disable-cxx --enable-posix \
--target=$TARGET --prefix=$INSTALL --enable-rtemsbsp=$BSP
make install

Note: autoconf must be recent and include RTEMS patches.

Build GDB (4 minutes)

gdb-6.3.tar.bz2 (13MB)

Apply latest RTEMS patch for gdb version (see above)

.../gdb-6.3/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --verbose --disable-nls \
--enable-sim --enable-sim-timebase --enable-sim-hardware \
--target=$TARGET --prefix=$INSTALL
make install

Note1: GCC 4.0.0 (and GCC 3.4) fails to compile gdb 5.3 as follows, you need to use GCC 3.3 OR add semi-colons as needed to make gcc happy.

gcc ... support.c
../../../gdb-5.3/sim/ppc/ppc-instructions: In function 'convert''to''integer':
../../../gdb-5.3/sim/ppc/ppc-instructions:1221: error: label at end of compound statement
make[wiki:2 2]: *** [wiki:Support.o support.o] Error 1
make[wiki:2 2]: Leaving directory `/home/guerby/work/gcc/cross/build5/sim/ppc'
make[wiki:1 1]: *** [wiki:All all] Error 2
make[wiki:1 1]: Leaving directory `/home/guerby/work/gcc/cross/build5/sim'
make: *** [wiki:All-sim all-sim] Error 2

Compile and Test

$ cat t.adb
with Ada.Text_IO;
procedure T is
   Ada.Text''IO.Put''Line ("Hello RTEMS Ada");
end T;
$ powerpc-rtems-gnatmake -f -g t -largs -BINSTALL -specs bsp_specs -qrtems
$ INSTALL/powerpc-rtems/psim/tests/runtest ./t

Then look in log/t

Note1: It appears that gnat (gcc 4.1 CVS) is mangling target names with periods in them. CPU-rtems4.7 is turning into CPU-rtems4.

Note2: It appears that gnat (gcc 4.1 CVS) is always looking for the cross tools in /usr/bin.

Old Build Instructions with GCC 3.2

make -C gcc cross-gnattools
make -C gcc ada.all.cross
make install