6.8. Binutils-2.28

The Binutils package contains a linker, an assembler, and other tools for handling object files.

6.8.1. Installation of Binutils

The Binutils documentation recommends building Binutils outside of the source directory in a dedicated build directory:

mkdir -v ../binutils-build
cd ../binutils-build

Prepare Binutils for compilation:

../binutils-2.28/configure \
    --prefix=/tools \
    --libdir=/tools/lib64 \
    --with-lib-path=/tools/lib64:/tools/lib \
    --build=${CLFS_HOST} \
    --host=${CLFS_TARGET} \
    --target=${CLFS_TARGET} \
    --disable-nls \
    --enable-shared \
    --enable-64-bit-bfd \
    --enable-gold=yes \
    --enable-plugins \
    --with-system-zlib \
    --enable-threads

The meaning of the new configure option:

--enable-shared

When this is specified, Binutils will create a shared libbfd and link its programs to it.

Compile the package:

make

Install the package:

make install

Details on this package are located in Section 10.25.2, “Contents of Binutils.”