In this section we're going to install Glibc. But before we'll be able to install these libraries, we need to have a bunch of other software installed on the LFS system. Therefore all these programs need to be linked statically. This means quite a bit of extra work, because after Glibc and the GNU CC compilers are installed, we're going to re-install all these programs so they'll be linked dynamically. If somebody knows of a better way to accomplish this, without first building all the software statically and then rebuild them dynamically, please let me know.
I know of one other way and that's by installing Glibc using pre-compiled binaries. But that would be directly against what we're doing here. So that's not an option.
All software that is being installed in this section will be compiled on our normal working Linux system and then copied to the LFS system.
You'll notice that the installation of this software is very straightforward is most cases. I also won't explain what this software does, since it's all trivial software and if you don't know what some program does, you can always read the README file and other documentation.
configuremake LDFLAGS=-staticmake binary to $LFS/usr/bin
configuremake LDFLAGS=-staticsed/sed binary to $LFS/usr/binThere is a possibility you will experience compilation problems. If this is the case, you can download a fixed version of this package from the following URL: http://tts.ookhoi.dds.nl/lfs-howto/download/sed-3.02-lfs.tar.gz
configuremake LDFLAGS=-staticdate echo false pwd sleep stty su true unamechrootbasename dirname env expr factor groups id logname nice nohup pathchk printenv
printf seq tee test tty uptime users who whoami yes
configuremake LDFLAGS=-staticchgrp chmod chown cp dd df dir dircolors du ln ls mkdir mkfifo mknod mv rm
rmdir sync touch vdirginstallcd $LFS/usr/bin;
ln -s ginstall install
configuremakemake
LDFLAGS=-staticosetup mount swapon umount$LFS/sbin/swapoff to $LFS/sbin/swapon
configuremake LDFLAGS=-staticcatcksum comm csplit cut expand fmt fold head join md5sum nl od paste pr sort
split sum tac tail tr unexpand uniq wc
configuremake LDFLAGS=-staticAfter compiling the programs in the src directory you will have two programs: tar and rmt. Tar is obvious. Rmt stands for ReMote Tapeserver. If you don't need this program (ie; you don't have a tapestreamer in your network or on your machine) then you don't need to copy this program.
src/tar binary to $LFS/binsrc/rmt binary to $LFS/bin (if you need it)
configuremake LDFLAGS=-staticgzexe.in zdiff.in zforce.in
zgrep.in zmore.in znew.ingunzip gzexe gzip zcat zdiff
zforce zgrep zmore znewThere is a possibility you will experience compilation problems. If this is the case, you can download a fixed version of this package from the following URL: http://tts.ookhoi.dds.nl/lfs-howto/download/gzip-1.2.4-lfs.tar.gz
configuremake LDFLAGS=-all-staticas-new gasp-new$LFS/usr/bin/as and $LFS/usr/bin/gaspld-new$LFS/usr/bin/ldaddr2line ar c++filt nm-new objcopy objdump ranlib size strings strip-new$LFS/usr/bin/nm$LFS/usr/bin/strip
configuremake LDFLAGS=-staticegrep fgrep grepThere is a possibility you will experience compilation problems. If this is the case, you can download a fixed version of this package from the following URL: http://tts.ookhoi.dds.nl/lfs-howto/download/grep-2.2-lfs.tar.gz
configuremake LDFLAGS=-staticbisonbison.hairy bison.simple
configuremake CFLAGS="-O -static"mawk$LFS/usr/bin/awk to $LFS/usr/bin/mawk
configuremake LDFLAGS=-staticfindThere is a possibility you will experience compilation problems. If this is the case, you can download a fixed version of this package from the following URL: http://tts.ookhoi.dds.nl/lfs-howto/download/findutils-4.1-lfs.tar.gz
configuremake LDFLAGS=-staticcmp diff diff3 sdiffThere is a possibility you will experience compilation problems. If this is the case, you can download a fixed version of this package from the following URL: http://tts.ookhoi.dds.nl/lfs-howto/download/diffutils-2.7-lfs.tar.gz
make lddmake ldconfig $LFS/bin:ldd $LFS/sbin: ldconfig
ConfigureYou can stick to all the default questions, except to the following.
When asked What is the file extension used for shared libraries? [so]
Answer with: none
When asked Any additional ld flags (NOT including libraries)? [-L/usr/local/lib]
Answer with: -L/usr/local/lib -static
When asked Do you wish to use dynamic loading? [y]
Answer with: n
makeperl
configuremake LDFLAGS=-staticm4There is a possibility you will experience compilation problems. If this is the case, you can download a fixed version of this package from the following URL: http://tts.ookhoi.dds.nl/lfs-howto/download/m4-1.4-lfs.tar.gz
configure --disable-nlsmake LDFLAGS=-staticmakeinfo
configureautomake aclocal$LFS/usr/share/automakeconfig.guess
config.sub install-sh mdate-sh missing mkinstalldirs elisp-comp ylwrap acinstall*.am files$LFS/usr/share/aclocal*.m4 files
configuremakeautoconf autoheader autoreconf
autoscan autoupdate ifnames$LFS/usr/share/autoconf*.m4* files
(in effect this means all *m4 and all *.m4f files)acconfig.h
acfunctions acheaders acidentifiers acprograms acmakevarsWe're not going to installed the latest Glibc version, 2.1.2, but version 2.0.7pre6. The reason is that glibc 2.1.2 requires at least gcc 2.8 (or egcs 1.1). My system has gcc 2.7.2.3 thus I can't compile the glibc2.1.2 library. And I also don't want to upgrade my working Linux system to gcc 2.95.2 (which is the latest version at the time of writing this document). Upgrading a compiler isn't as easy as it sounds and I don't want to break things on this working system.
So therefore I have to install glibc 2.0.7pre6. However, we are going to install the gcc 2.95.2 compiler. We also need to install the gcc 2.7.2.3 compiler because certain software can't be compiled with gcc 2.95.2 (due to bugs in the programs that aren't really bugs but the gcc 2.95.2 compiler defines them as bugs. This is not a bug in the compiler, but changes in the C standard (if I understood it correctly)).
A note on the glibc-crypt package. The following is quoted from the glibc-crypt-README file on ftp://ftp.gnu.org/gnu/glibc:
-*-*-*-*-*- The add-on is not included in the main distribution of the GNU C library because some governments, mostly notable 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 license, including via the Internet. So please do not download it from the main FSF FTP site at ftp.gnu.org if you are outside of 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/2.0.7pre6/. 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 it from that German site.
configure
--with-gnu-binutils --enable-shared --enable-add-ons=linuxthreads,cryptconfigparms containing the following:
# Begin configparms prefix=/usr slibdir=/lib sysconfdir=/etc # End configparms
make/usr/lib/gcc-lib to the usr/lib/gcc-lib directory
on the normal Linux system.make install/usr/lib/gcc-lib symlinkYou can check if the GNU C Library seems to be working by running a dynamically
linked program that uses this library (like almost every program). A simple
test is running the ls program that resides in the bin directory on your normal
Linux partition. If you can run this program without any errors, then the GNU
C Library seems to be installed correctly.
Please not that if your normal Linux system uses a differnet library version that the one you just installed on your LFS system, that program will most likely crash and reported a 'Segmentation Fault' or something similar. If so, just continue with the installation of the C++ Library and the compilers. After the compilers are done you will compile a small test program and execute it for the sake of testing the compiler. If those two little programs execute without crashing, it means that 1) the compiler works 2) the C Library works too. So don't worry too much right now if programs from your normal Linux system don't work due to C Library incompatibilities.
If you have used a previous version of this HOWTO to install an LFS system and you wish to update your LFS system conforming the changes made in this version of the HOWTO, you first need to remove the existing files regarding the previously installed C++ library before continuing with this section.
This HOWTO used to install the C++ library from sources, but that has been changed and is an exception. The C++ library is installed from pre-compiled binaries. The reason is that I have not been able to find the sources for the C++ library version that I prefer to use. So until then we'll use pre-compiled binaries.
ar x libstdc++2.9_2.91.66-0slink2.debtar xvfz data.tar.gzcp -av usr /usr data.tar.gz control.tar.gz
debian-binary
ar x libstdc++2.9-dev_2.91.66-0slink2.debtar xvfz data.tar.gzcp -av usr /usr data.tar.gz control.tar.gz
debian-binary