The Binutils package contains a linker, an assembler, and other tools for handling object files.
To make sure that the proper syntax is used for a couple of tools, apply the following patch:
patch -Np1 -i ../binutils-2.17-posix-1.patch
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.17/configure --prefix=/usr \
--build=${CLFS_HOST} --host=${CLFS_TARGET} \
--target=${CLFS_TARGET} --enable-shared
Compile the package:
make configure-host
During make configure-host you may receive the following error message. It is safe to ignore.
WARNING: `flex' is missing on your system. You should only need it if you modified a `.l' file. You may need the `Flex' package in order for those modifications to take effect. You can get `Flex' from any GNU archive site.
make tooldir=/usr
The meaning of the make parameter:
Normally, the tooldir (the directory where the executables will ultimately be located) is set to $(exec_prefix)/$(target_alias). Because this is a custom system, this target-specific directory in /usr is not required.
Install the package:
make DESTDIR=${CLFS} tooldir=/usr install
Install the libiberty header file that is needed by some packages:
cp -v ../binutils-2.17/include/libiberty.h ${CLFS}/usr/include