10.6. Glibc-2.4 32 Bit Libraries

#### Cross-Compiled Linux From Scratch - Version 1.0.0rc2-MIPS64-Multilib

### Chapter 10. Installing Basic System Software

- Prev

  Linux-Headers-2.6.17.4-07112006

- Next

  Glibc-2.4 N32

- Up.
- Home

# 10.6. Glibc-2.4 32 Bit Libraries

The Glibc 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.

## 10.6.1. Installation of Glibc

### Note

Some packages outside of CLFS suggest installing GNU libiconv in order to translate data from one encoding to another. The project's home page (http://www.gnu.org/software/libiconv/) says “This library provides an `iconv()` implementation, for use on systems which don't have one, or whose implementation cannot convert from/to Unicode.” Glibc provides an `iconv()` implementation and can convert from/to Unicode, therefore libiconv is not required on a CLFS system.

The Glibc build system is self-contained and will install perfectly, even though the compiler specs file and linker are still pointing at `/tools`. The specs and linker cannot be adjusted before the Glibc install because the Glibc autoconf tests would give false results and defeat the goal of achieving a clean build.

MIPS is no longer supported in the main glibc tree, so we have to extract the glibc-ports-2.4 package into our glibc-2.4 directory. Then we move ports to the location expected by our build and patches:

    tar -jxvf ../glibc-ports-2.4.tar.bz2
    mv -v glibc-ports-2.4 ports

The following patch fixes a link issues when building MIPS glibc:

    patch -Np1 -i ../glibc-2.4-mips_fixes-1.patch

The following patch fixes an issue that can cause localdef to segfault:

    patch -Np1 -i ../glibc-2.4-localedef_segfault-1.patch

The following patch fixes an issue with iconv:

    patch -Np1 -i ../glibc-2.4-iconv_fix-1.patch

The following sed fixes a build issue with Glibc. This will prevent nscd from trying to link to libraries that don't exist:

    cp -v nscd/Makefile{,.orig}
    sed -e "/nscd_stat.o: sysincludes = # nothing/d" nscd/Makefile.orig > \
        nscd/Makefile

The Glibc documentation recommends building Glibc outside of the source directory in a dedicated build directory:

    mkdir -v ../glibc-build
    cd ../glibc-build

Prepare Glibc for compilation:

    CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" \
        ../glibc-2.4/configure --prefix=/usr \
        --disable-profile --enable-add-ons --enable-kernel=2.6.0 \
        --libexecdir=/usr/lib/glibc --host=${CLFS_TARGET32}

The meaning of the new configure option:

`--libexecdir=/usr/lib/glibc`

  This changes the location of the pt_chown program from its default of `/usr/libexec` to `/usr/lib/glibc`.

Compile the package:

    make

### Important

The test suite for Glibc is considered critical. Do not skip it under any circumstance.

Test the results:

    make -k check >glibc-check-log 2>&1 ; grep Error glibc-check-log

The Glibc test suite is highly dependent on certain functions of the host system, in particular the kernel. In general, the Glibc test suite is always expected to pass. However, in certain circumstances, some failures are unavoidable. This is a list of the most common issues:

- The math tests, at least on i686, fail in the test-double and test-idouble tests with gcc-4.1.1, the grep command will also report an expected (ignored) failure in posix/annexc . These two failures in the math tests appear to be harmless. The math tests may also fail on systems where the CPU is not a relatively new genuine Intel or authentic AMD. Certain optimization settings are also known to be a factor here.

- The gettext test sometimes fails due to host system issues. The exact reasons are not yet clear.

- If you have mounted the CLFS partition with the `noatime` option, the atime test will fail. As mentioned in Section 2.4, “Mounting the New Partition”, do not use the `noatime` option while building CLFS.

- When running on older and slower hardware, some tests can fail because of test timeouts being exceeded.

Though it is a harmless message, the install stage of Glibc will complain about the absence of `/etc/ld.so.conf`. Prevent this warning with:

    touch /etc/ld.so.conf

Install the package:

    make install

Details on this package are located in Section 10.8.5, “Contents of Glibc.”

- Prev

  Linux-Headers-2.6.17.4-07112006

- Next

  Glibc-2.4 N32

- Up.
- Home.