5.17. EGLIBC-2.15 N32

Le paquet EGLIBC contient la bibliothèque C principale. Cette bibliothèque fournit toutes les routines de base pour allouer de la mémoire, rechercher dans des répertoires, ouvrir et fermer des fichiers, les lire et les écrire, gérer les chaînes, faire de la recherche de motifs, faire de l'arithmétique etc.

5.17.1. Installation of EGLIBC

Remarquez que toute autre méthode de construction Glibc que celle suggérée dans ce livre met en péril la stabilité du système.

MIPS is not supported in the main EGLIBC tree, so we need the eglibc-ports tarball. Unpack eglibc-ports-2.15-r21467:

tar -xvf ../eglibc-ports-2.15-r21467.tar.xz

Désactivez l'édition d'un lien vers libgcc_eh:

cp -v Makeconfig{,.orig}
sed -e 's/-lgcc_eh//g' Makeconfig.orig > Makeconfig

The following will cause EGLIBC to use an absolute path to the ldd-rewrite-script instead of a relative path:

cp -v config.make.in{,.orig}
sed '/ldd-rewrite-script/s:@:${objdir}/&:' config.make.in.orig > config.make.in

La documentation d'EGLIBC recommande de construire EGLIBC en dehors du répertoire des sources dans un répertoire de construction dédié :

mkdir -v ../eglibc-build
cd ../eglibc-build

Vous devez ajouter les lignes suivantes à config.cache pour qu'EGLIBC supporte NPTL :

cat > config.cache << "EOF"
libc_cv_forced_unwind=yes
libc_cv_c_cleanup=yes
libc_cv_gnu89_inline=yes
libc_cv_ssp=no
EOF

Tell EGLIBC to install its 32-bit libraries into /tools/lib32:

echo "slibdir=/tools/lib32" >> configparms

Préparez la compilation d'EGLIBC :

BUILD_CC="gcc" CC="${CLFS_TARGET}-gcc ${BUILDN32}" \
    AR="${CLFS_TARGET}-ar" RANLIB="${CLFS_TARGET}-ranlib" \
    ../eglibc-2.15/configure --prefix=/tools \
    --host=${CLFS_TARGET} --build=${CLFS_HOST} --libdir=/tools/lib32 \
    --disable-profile --with-tls --enable-kernel=2.6.32 --with-__thread \
    --with-binutils=/cross-tools/bin --with-headers=/tools/include \
    --cache-file=config.cache

The meaning of the new configure options:

CC="${CLFS_TARGET}-gcc ${BUILDN32}"

Forces EGLIBC to utilize our target architecture GCC utilizing the N32 flags.

--libdir=/tools/lib32

Installs EGLIBC into /tools/lib32 instead of /tools/lib.

Pendant cette étape, il se pourrait que les avertissements suivants apparaissent :

configure: WARNING:
*** These auxiliary programs are missing or
*** incompatible versions: msgfmt
*** some features will be disabled.
*** Check the INSTALL file for required versions.

L'absence ou l'incompatibilité du programme msgfmt n'est en général pas gênant. Ce programme msgfmt fait partie du paquet Gettext que la distribution hôte devrait fournir.

Compilez le paquet :

make

Installez le paquet :

make install inst_vardbdir=/tools/var/db

Details on this package are located in Section 10.9.5, “Contenu d'EGLIBC.”