Building RTEMS-4.10 Tools for Lattice Mico32 (lm32)

  • Print

To build the tools you will need the sources for the Lattice Mico32 GNU Tools which you can download from the Lattice site.

You will also need the sources for newlib-1.16.0.cvs.20081127 from the RTEMS ftp server and RTEMS specific patches for newlib.

In addition to these sources you will need the following patches:

binutils-2.18-rtems4.10-lm32-20081117.diff
gcc-3.4.4-rtems4.10-lm32-20081209.diff
newlib-1.16.0.cvs.lm32-20081127.diff

The tools can be built for example on Fedora 9, however, the versions automake and autoconf required by rtems-4.10 are not provided here so these have to be installed separately (see RTEMS Wiki for detailed instructions how to load Yum repository configuration information).

yum -y install "*4.10*auto*"

Download the sources and patches listed above and build and install the tools following.

mkdir build-lm32-tools
cd build-lm32-tools/
tar zxf ../tool-sources/mico32_gnutools_src_7.1.tar.gz

Apply patch for binutils

cd src/binutils
patch -p1 < ../../../tool-sources/binutils-2.18-rtems4.10-lm32-20081117.diff
cd ../..

Build and install binutils

mkdir b-binutils
cd b-binutils
../src/binutils/configure --prefix=/opt/rtems-4.10 --target=lm32-rtems4.10 \
--disable-nls
make -w all
make install (as root)
cd ..

Untar and patch newlib-1.16.0.cvs

tar zxf ../tool-sources/newlib-1.16.0.cvs.20081127.tar.gz
cd newlib-1.16.0
patch -p1 < ../../tool-sources/newlib-1.16.0.cvs.lm32.20081127.diff
patch -p1 < ../../tool-sources/newlib-1.16.0.cvs.20081128-rtems4.10-20081128.diff
cd newlib/libc/machine/lm32/
aclocal -I ../../..
autoconf
automake -a --cygnus Makefile
cd ../../../../..

We need to replace the version of newlib supplied with the Lattice sources with a more recent one and patch the gcc sources.

cd src
rm -rf newlib
cd gcc
ln -s ../../newlib-1.16.0/newlib newlib
patch -p1 < ../../../tool-sources/gcc-3.4.4-rtems4.10-lm32-20081209.diff
cd ../..

Now build and install gcc and newlib

PATH=/opt/rtems-4.10/bin:${PATH}
mkdir b-gcc
cd b-gcc
../src/gcc/configure --prefix=/opt/rtems-4.10 --bindir=/opt/rtems-4.10/bin \
--exec_prefix=/opt/rtems-4.10 --includedir=/opt/rtems-4.10/include \
--libdir=/opt/rtems-4.10/lib --libexecdir=/opt/rtems-4.10/libexec \
--mandir=/opt/rtems-4.10/man --infodir=/opt/rtems-4.10/info \
--datadir=/opt/rtems-4.10/share --target=lm32-rtems4.10 \
--enable-languages=c,c++ --with-newlib --enable-sjlj-exceptions \
--disable-nls --disable-libstdcxx-patch --with-gnu-as --with-gnu-ld \
--verbose --with-system-zlib --enable-version-specific-runtime-libs \
--enable-threads=rtems
make -w all
make install (as root)