Building a cross-compile toolchain for rtmk

This document gives you some step-by-step help to configurating and installing a rtmk cross-compile toolchain.

Note that you do not need this toolchain to build rtmk itself. The toolchain is used to build software that are using the rtmk microkernel.

The GNU C library should not be built in the source directory. I suggest that you do not build the others in their source directories as well.

1. Binutils

First, you need the sources to binutils 2.11.2, and you also need the rtmk patch. Untar and apply the patch to the sources;
  $ cd binutils-2.11.1
  $ zcat ~/binutils-2.11.1-rtmk-patch.gz | patch -p1
Configure for target `i686-pc-rtmk' and just run `make install'.

2. GCC

Download the sources for GCC 3.0.1 (use only the gcc-core tarball, we do *NOT* want java or objc, okey?), and apply the GCC patch;
  $ cd gcc-3.0.1
  $ zcat ~/gcc-3.0.1-rtmk-patch.gz | patch -p1
Configure for target `i686-pc-rtmk' and just run `make install'.

3. rtmk

Untar the rtmk sources and configure it using the new toolchain. Since we not yet have a C library, we must ignore the standard libraries and start files; (??? rig)
  $ cd rtmk-VERSION
  $ CC=i686-pc-rtmk-gcc CFLAGS="-nostdlib -nostartfiles -g -O2" AR=i686-pc-rtmk-ar \
       RANLIB=i686-pc-rtmk-ranlib ./configure --host=i686-pc-rtmk
  $ make install prefix=/usr/local/i686-pc-rtmk
This will install the headers into /usr/local/i686-pc-rtmk/include, which is in the default include search path. Also the rtmk library in /usr/local/i686-pc-rtmk/lib.

4. The GNU C Library

Download the GNU C library (version 2.2.4) tarball and untar it, and apply the glibc patch To configure it; (Since we are using GCC 3.0.1, we must disable sanity checks)
  $ cd glibc-2.2.4
  $ zcat ~/glibc-2.2.4-rtmk-patch.gz | patch -p1
  $ mkdir build ; cd build
  $ CC=i686-pc-rtmk-gcc AR=i686-pc-rtmk-ar RANLIB=i686-pc-rtmk-ranlib AS=i686-pc-rtmk-as \
     ../configure --host=i686-pc-rtmk --disable-shared --with-elf --disable-profile --enable-libio --disable-sanity-checks
After this, you should be able to simply just run `make install prefix=/usr/local/i686-pc-rtmk/'.


You should now have a comple cross-compile toolchain for rtmk.

johan rydberg Last modified: Mon Dec 14 23:50:34 CET 2001