6.10. uClibc-0.9.29

The uClibc package contains ... TO BE WRITTEN

User Notes: http://wiki.linuxfromscratch.org/hlfs/wiki/uclibc

6.10.1. Installation of uClibc

Apply the fixes patch:

patch -Np1 -i ../uClibc-0.9.29-fixes-1.patch

Put the pre-generated locale tarball where uClibc can find it:

install -m444 ../uClibc-locale-030818.tgz extra/locale/

This patch will get your config started:

patch -Np1 -i ../uClibc-0.9.29-config-1.patch

Next run menuconfig. This is very similar to the kernel's menuconfig.

UCLIBC_HAS_WCHAR is needed to build g++. UCLIBC_HAS_RPC is needed to build Util-Linux (nfsmount). UCLIBC_HAS_FULL_RPC is not required, but Util-Linux will use pre-generated data if it is not enabled. DO_C99_MATH is needed for Iproute2 for the rint function. UCLIBC_HAS_GLIBC_CUSTOM_PRINTF (printf.h) is needed for some packages, like Reiserfsprogs, but nothing in the base system. UCLIBC_HAS_WORDEXP is needed to install Alsa-Lib. Enable all the security options, except SSP. The UCLIBC_SUSV3_LEGACY option is needed to provide index, even though it is depreciated many packages, including uClibc's menuconfig, need it. The UCLIBC_SUSV3_LEGACY_MACROS option is problematic with some packages, like GCC. The make defconfig and make allyesconfig targets are not recommended. The install prefixes are already set correctly by the config patch.

Things you might want to change are Processor-Family, and IPV6.

make menuconfig

Compile and install the package:

make
make install

Then make and install the utilities:

make headers
make CC="gcc -Wl,--dynamic-linker,/lib/ld-uClibc.so.0 /lib/libc.so.0" \
    -C utils
install -v utils/{iconv,ldd} /usr/bin/
install -v utils/ldconfig /sbin/

Remove the static libs. Save libc.a for GCC's tests. libdl.a is needed for Binutils testsuite:

install -vd /usr/lib/static/
mv -v /usr/lib/{libcrypt,libm,libnsl,libpthread}.a /usr/lib/static
mv -v /usr/lib/{libresolv,librt,libutil}.a /usr/lib/static/

Remove these symlinks:

rm -v /usr/lib/{libc_pic,libcrypt_pic,libm_pic,libnsl_pic}.a
rm -v /usr/lib/{libpthread_pic,libresolv_pic,librt_pic,libutil_pic}.a

6.10.2. Configuring Dynamic Loader

Create a new file /etc/ld.so.conf by running the following:

echo "/usr/local/lib" > ld.so.conf.new
install -v -m644 ld.so.conf.new /etc/ld.so.conf

6.10.3. Configuring the Timezone

The system timezone is set with the /etc/TZ file. Users can use the TZ environment variable for their local time. See http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html and/or http://leaf.sourceforge.net/doc/guide/buci-tz.html#id2599108 for a more complete description. This example is for eastern standard time, and it will adjust by 1 hour automatically for daylight savings time:

echo "EST5EDT" > TZ.new
install -m644 TZ.new /etc/TZ

6.10.4. Contents of uClibc

Installed programs: ??, ??, ??
Installed libraries: ??, ??, ??