An excerpt from the README file that is distributed with the glibc-crypt package:
The add-on is not included in the main distribution of the GNU C library because some governments, most notably those of France, Russia, and the US, have very restrictive rules governing the distribution and use of encryption software. Please read the node "Legal Problems" in the manual for more details.
In particular, the US does not allow export of this software without a licence, including via the Internet. So please do not download it from the main FSF FTP site at ftp.gnu.org if you are outside the US. This software was completely developed outside the US.
"This software" refers to the glibc-crypt package at ftp://ftp.gwdg.de/pub/linux/glibc/. This law only affects people who don't live in the US. It's not prohibited to import DES software, so if you live in the US you can import the file safely from Germany without breaking cryptographic laws. This law is changing lately and I don't know what the status of it is at the moment. Better be safe than sory.
Unpack the glibc-crypt and glibc-linuxthreads in the glibc-2.1.3 directory, not in /usr/src. Don't enter the created directories. Just unpack them and leave it with that.
A few default parameters of Glibc need to be changed, such as the directory where the shared libraries are supposed to be installed in and the directory that contains the system configuration files. For this purpose you need to create the $LFS/usr/src/glibc-build directory and in that directory you create a new file configparms containing the following:
# Begin configparms
slibdir=/lib
sysconfdir=/etc
# End configparms
If your system had already a suitable GCC version installed, change to the $LFS/usr/src/glibc-build directory and install Glibc by running the following commands:
root:glibc-build# ../glibc-2.1.3/configure \
> --prefix=/usr --enable-add-ons \
> --with-headers=$LFS/usr/include
root:glibc-build# make
root:glibc-build# make install_root=$LFS install
If you're getting errors related to illegal character 45 in some variable name during the compilation, apply the Glibc patch to the glibc-2.1.3 directory by running the following command:
root:glibc-2.1.3# patch -Np1 -i ../glibc-2.1.3.patch
If your system didn't have a suitable GCC version installed, change to the $LFS/usr/src/glibc-build directory and install Glibc using the gcc-2.95.2 you just installed by running the following commands:
root:glibc-build# CC=/usr/local/gcc2952/bin/gcc \
> ../glibc-2.1.3/configure --prefix=/usr --enable-add-ons \
> --with-headers=$LFS/usr/include
root:glibc-build# make
root:glibc-build# make install_root=$LFS install
If you're getting errors related to illegal character 45 in some variable name during the compilation, apply the Glibc patch to the glibc-2.1.3 directory by running the following command:
root:glibc-2.1.3# patch -Np1 -i ../glibc-2.1.3.patch
If your normal Linux system runs glibc-2.0, you need to copy the NSS library files to the LFS partition. Certain statically linked programs still depend on the NSS library, especially programs that need to lookup usernames,userid's and groupid's. You can check which C library version your normal Linux system uses by running:
root:~# ls /lib/libc*
Your system uses glib-2.0 if there is a file that looks like libc-2.0.7.so
Your system uses glibc-2.1 if there is a file that looks like libc-2.1.3.so
Of course, the micro version number can be different (you could have libc-2.1.2 or libc-2.1.1 for example).
If you have a libc-2.0.x file copy the NSS library files by running:
root:~# cp -av /lib/libnss* $LFS/lib
There are a few distributions that don't have files from which you can see which version of the C Library it is. If that's the case, it will be hard to determine which C library version you exactly have. Try to obtain this information using your distribution's installation tool. It often says which version it has available. If you can't figure out at all which C Library version is used, then copy the NSS files anyway and hope for the best. That's the best advise I can give I'm afraid.
The Glibc package contains the GNU C Library.
The C Library is a collection of commonly used functions in programs. This way a programmer doens't need to create his own functions for every single task. The most common things like writing a string to your screen are already present and at the disposal of the programmer.
The C library (actually almost every library) come in two flavours: dynamic ones and static ones. In short when a program uses a static C library, the code from the C library will be copied into the executable file. When a program uses a dynamic library, that executable will not contain the code from the C library, but instead a routine that loads the functions from the library at the time the program is run. This means a significant decrease in the file size of a program. If you don't understand this concept, you better read the documentation that comes with the C Library as it is too complicated to explain here in one or two lines.