5.6. Installing Binutils-2.12

Estimated build time:           6 minutes
Estimated required disk space:  96 MB

5.6.1. Installation of Binutils

This package is known to behave badly when you have changed its default optimization flags (including the -march and -mcpu options). Binutils is best left alone, so we recommend you unsetting CFLAGS, CXXFLAGS and other such variables/settings that would change the default optimization that it comes with.

Install Binutils by running the following commands:

mkdir ../binutils-build &&
cd ../binutils-build &&
../binutils-2.12/configure --prefix=$LFS/usr --disable-nls &&
make LDFLAGS=-all-static tooldir=$LFS/usr &&
make tooldir=$LFS/usr install

5.6.2. Command explanations

mkdir ../binutils-build: The installation instructions for Binutils recommend creating a seperate build directory instead of compiling the package inside the source tree. So, we create a binutils-build directory and work from there.

--disable-nls: This option disabled internationalization (also known as i18n). We don't need this for our static programs and nls often causes problems when you're linking statically.

LDFLAGS=-all-static: Setting the variable LDFLAGS to the value -all-static causes binutils to be linked statically.

tooldir=$LFS/usr: Normally, the tooldir (the directory where the executables from binutils end up in) is set to $(exec_prefix)/$(target_alias) which expands into, for example, /usr/i686-pc-linux-gnu. Since we only build for our own system, we don't need this target specific directory in $LFS/usr. That setup would be used if the system was used to cross-compile (for example compiling a package on the Intel machine that generates code that can be executed on Apple PowerPC machines).

5.6.3. Contents of binutils-2.11.2

5.6.3.2. Descriptions

5.6.4. Dependencies

Binutils-2.11.2 needs the following to be installed:


autoconf: autoconf, autoheader
automake: aclocal, automake
bash: sh
binutils: ar, as, ld, nm, ranlib, strip
diffutils: cmp
fileutils: chmod, cp, ln, ls, mkdir, mv, rm, rmdir, touch
flex: flex
gcc: cc, cc1, collect2, cpp0, gcc
glibc: ldconfig
grep: egrep, fgrep, grep
m4: m4
make: make
gawk: gawk
sed: sed
sh-utils: basename, echo, expr, hostname, sleep, true, uname
texinfo: install-info, makeinfo
textutils: cat, sort, tr, uniq