Next Previous Contents

12. Runtime Library

12.1 glibc

http://www.gnu.org/software/libc/ and http://sources.redhat.com/glibc/

Modern releases of glibc are very large for a traditional embedded system. If your application requires only one or two user programs, you can statically link them to avoid requiring the entire dynamic library. Another option is to hand-strip the dynamic library to a bare minimum.

The are some modifications required to official glibc-2.1.x releases to make them work in the embedded PowerPC environment, such as cache line size mods. See: http://lists.linuxppc.org/listarcs/linuxppc-embedded/199909/msg00000.html

After applying these mods, glibc-2.1.x can be configured for cross-compiling with:

    #!/bin/sh
    export PATH=/path/to/local/i686-pc-linux-gnu/bin:$PATH
    export CFLAGS="-msoft-float -O2 -DNDEBUG=1"
    export CC=powerpc-linux-gcc
    export AR=powerpc-linux-ar
    export RANLIB=powerpc-linux-ranlib
    configure --host=powerpc-linux --prefix=/path/to/local/powerpc-linux \
    --with-headers=/path/to/linux-2.2.13/include --enable-add-ons=linuxthreads \
    --with-gnu-as --with-gnu-ld --disable-sanity-checks --without-fp

There is a magic script named mklibs.sh which removes unused functions from the shared C library in the Debian Boot Floppies package, at: ftp://ftp.us.debian.org/debian/dists/potato/main/source/admin/boot-floppies_2.2.16.tar.gz

12.2 sglibc

There is an attempt to produce a small glibc suitable for embedded systems at: http://external-lists.varesearch.com/lists/listinfo/sglibc

To cut down some of the bloat in glibc, apply the patches at: http://external-lists.varesearch.com/archives/sglibc/1999-September/000007.html ftp://ftp.valinux.com/pub/support/hjl/glibc/glibc-old_version.tar.gz

12.3 libc5

Older Linux libc's are often quite small. There is one on the Linux/PPC embedded ftp site.

12.4 dietlibc

http://www.fefe.de/dietlibc/

This project aims to make it easy to create small statically linked programs under Linux.

12.5 newlib

http://sources.redhat.com/newlib/

newlib may be another option, although it currently lacks the libgloss layer necessary to use as the C library under Linux.


Next Previous Contents