6.11. uClibc-0.9.31

The uClibc package contains the main C library. This library provides the basic routines for allocating memory, searching directories, opening and closing files, reading and writing files, string handling, pattern matching, arithmetic, and so on.

6.11.1. Installation of uClibc

[Note]

Note

Below we are just telling uClibc to use its default configuration. For those who are more adventurous, you can use make menuconfig and do a more custom build for your uClibc installation.

The following patch contains the default configurations for the architectures covered in this book:

patch -Np1 -i ../uClibc-0.9.31-configs-2.patch

For the MIPS architecture, there are many different combinations of configurations that can be used when building uClibc based on the choices made previously for: endianess, ABI, and MIPS level. To ensure that the proper configuration is used based on those choices, first copy the configuration matching the endianess chosen, then update the ABI and MIPS level:

cp -v clfs/config.${CLFS_ARCH}.${CLFS_ENDIAN} .config
if [ "${CLFS_ABI}" == "n32" ]; \
then sed -i s/CONFIG_MIPS_O32_ABI/CONFIG_MIPS_N32_ABI/g .config; \
elif [ "${CLFS_ABI}" == "64" ]; \
then sed -i s/CONFIG_MIPS_O32_ABI/CONFIG_MIPS_N64_ABI/g .config; fi; \
if [ "${CLFS_MIPS_LEVEL}" == "3" ]; \
then sed -i s/CONFIG_MIPS_ISA_1/CONFIG_MIPS_ISA_3/g .config; fi

The config is a basic working system, but there are some options that are architecture specifc that need to be set. The following command will only bring up items that need a value that we did not specify in our generic config file patch:

make oldconfig

Compile the package:

make

Install the package:

make PREFIX=${CLFS} install

6.11.2. Contents of uClibc

Installed Programs: ld-uClibc.so.0
Installed Libraries: libc.so.0, libcrypt.so.0, libdl.so.0, libm.so.0, libpthread.so.0, librt.so.0
Installed Headers: To be written...

Short Descriptions

ld-uClibc

The uClibc dynamic linker / loader

libc

The C library

libcrypt

The cryptographic library

libdl

The uClibc dynamic linker / loader library

libm

The math library

libpthread

The POSIX thread library

librt

The clock and timer library