%general-entities; ]> Glibc-&glibc-version; Glibc cross tools Installation of Glibc It should be noted that compiling Glibc in any way other than the method suggested in this book puts the stability of the system at risk. Disable linking to libgcc_eh: patch -Np1 -i ../&glibc-libgcc_eh-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 nscd/Makefile{,.orig} sed -e "/nscd_stat.o: sysincludes = # nothing/d" nscd/Makefile.orig > nscd/Makefile For NPTL enabled systems the following lines need to be added to config.cache: echo "libc_cv_forced_unwind=yes" > config.cache echo "libc_cv_c_cleanup=yes" >> config.cache BUILD_CC="gcc" CC="${LFS_TARGET}-gcc" \ AR="${LFS_TARGET}-ar" RANLIB="${LFS_TARGET}-ranlib" \ ../glibc-&glibc-version;/configure --prefix=/tools \ --host=${LFS_TARGET} --build=${LFS_HOST} \ --disable-profile --enable-add-ons \ --with-tls --enable-kernel=2.6.0 --with-__thread \ --with-binutils=/cross-tools/bin --with-headers=/tools/include \ --cache-file=config.cache The meaning of the new configure options: BUILD_CC="gcc" This sets Glibc to use the current compiler on our system. This is used to create the tools Glibc uses during its build. CC="${LFS_TARGET}-gcc" This forces Glibc to use the GCC compiler that we made for our target architecture. AR="${LFS_TARGET}-ar" This forces Glibc to use the ar utility we made for our target architecture. RANLIB="${LFS_TARGET}-ranlib" This forces Glibc to use the ranlib utility we made for our target architecture. --disable-profile This builds the libraries without profiling information. Omit this option if profiling on the temporary tools is necessary. --enable-add-ons This tells Glibc to utilize all add-ons that are available. --with-tls This tells Glibc to use Thread Local Storage. --with-__thread This tells Glibc to use use the __thread for libc and libpthread builds. --with-binutils=/cross-tools/bin This tells Glibc to use the Binutils that are specific to our target architecture. --cache-file=config.cache This tells Glibc to utilize a premade cache file. During this stage the following warning might appear:
configure: WARNING: *** These auxiliary programs are missing or *** incompatible versions: msgfmt *** some features will be disabled. *** Check the INSTALL file for required versions.
The missing or incompatible msgfmt program is generally harmless. This msgfmt program is part of the Gettext package which the host distribution should provide. Compile the package: make Install the package: make install
<para>Details on this package are located in <xref linkend="contents-glibc" role="."/></para> </sect2> </sect1>