The Binutils package contains a linker, an assembler, and other tools for handling object files.
This package is known to have issues when its default optimization flags (including the -march and -mcpu options) are changed. If any environment variables that override default optimizations have been defined, such as CFLAGS and CXXFLAGS, unset them when building Binutils.
Verify that the PTYs are working properly inside the chroot environment. Check that everything is set up correctly by performing a simple test:
expect -c "spawn ls"
If the following message shows up, the chroot environment is not set up for proper PTY operation:
The system has no more ptys. Ask your system administrator to create more.
This issue needs to be resolved before running the test suites for Binutils and GCC.
The Binutils documentation recommends building Binutils outside of the source directory in a dedicated build directory:
mkdir ../binutils-build cd ../binutils-build
Prepare Binutils for compilation:
../binutils-2.15.94.0.2.2/configure --prefix=/usr \ --enable-shared
Compile the package:
make tooldir=/usr
Normally, the tooldir (the directory where the executables will ultimately be located) is set to $(exec_prefix)/$(target_alias). For example, i686 machines would expand that to /usr/i686-pc-linux-gnu. Because this is a custom system, this target-specific directory in /usr is not required. $(exec_prefix)/$(target_alias) would be used if the system was used to cross-compile (for example, compiling a package on an Intel machine that generates code that can be executed on PowerPC machines).
The test suite for Binutils in this section is considered critical. Do not skip it under any circumstances.
Test the results:
make check
Install the package:
make tooldir=/usr install
Install the libiberty header file that is needed by some packages:
cp ../binutils-2.15.94.0.2.2/include/libiberty.h /usr/include