µ C l i b c
About Documentation Obtain Development Links

Toolchains

To use uClibc, you need to have a toolchain. A toolchain consists of GNU binutils, the GNU Compiler Collection GCC, and uClibc, all built to produce binaries for your target system linked with uClibc. You can build your own native uClibc toolchain using the uClibc buildroot system.

To build your own uClibc toolchain, follow the following simple steps:

  • Point your web browser here,
  • Download of copy of buildroot
  • Unpack the tarball on your Linux system somewhere
  • Edit the Makefile as needed if you wish to change anything.
  • run 'unset CC'. Then run 'unset CXX'. Some Linux systems (i.e. Gentoo) set variables such as 'CC' in the system environment which really messes things up when cross compiling.
  • run 'make menuconfig'
  • Select the things you want to build. If you only want a toolchain, leave everything except the toolchain disabled.
  • save your buildroot configuration.
  • run 'make'
  • go eat a nice wholesome sandwich, drink a pop, call a friend, play a video game, and generally find something to do. While you are waiting, buildroot will download all the needed source code and then compile things up for you.
  • You should now have a shiny new toolchain, and maybe even a shiny new uClibc based root filesystem or development system, depending on the options you selected.

If you want to be really lazy and start using uClibc right away without needing to compile your own toolchain or anything, you can grab a pre-compiled uClibc development system. These are currently available for arm, armeb, i386, mips, mipsel, powerpc, and sh4.

Note: that the images mentioned above are old and ment for demonstration purposes only.

These are bzip2 compressed ext2 filesystems containing all the development software you need to build your own uClibc applications, including: bash, awk, make, gcc, g++, autoconf, automake, ncurses, zlib, openssl, openssh, gdb, strace, busybox, GNU coreutils, GNU tar, GNU grep, etc.

Each of these uClibc development systems was created using buildroot, specifically, buildroot-0.9.27.tar.bz2 along with these sources.

These development systems should provide pretty much everything you need to get started building your own applications with uClibc. Once you download one of these systems, you can then boot into it, loop mount it, dd it to a spare drive and use a tool such as resize2fs to make it fill a partition... Whatever works best for you.

The quickest way to get started using a root_fs image (using the i386 platform as an example) is:

  • Download root_fs_i386.bz2 from uclibc.org
  • bunzip2 root_fs_i386.bz2
  • mkdir root_fs
  • su root
  • mount -o loop root_fs_i386 root_fs
  • chroot root_fs /bin/su -
Type "exit" to end the chroot session and return to your host system.


Copyright © 1999-2012 Erik Andersen
Mail all comments, insults, suggestions and bribes to
Bernhard Reutner-Fischer
This site created with the vi editor This site is kindly hosted by OSL