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 -v ../binutils-build cd ../binutils-build
Prepare Binutils for compilation:
../binutils-126.96.36.199.2.2/configure --prefix=/usr \ --enable-shared
Compile the package:
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:
Install the package:
make tooldir=/usr install
Install the libiberty header file that is needed by some packages:
cp -v ../binutils-188.8.131.52.2.2/include/libiberty.h /usr/include
Translates program addresses to file names and line numbers; given an address and the name of an executable, it uses the debugging information in the executable to determine which source file and line number are associated with the address
Creates, modifies, and extracts from archives
An assembler that assembles the output of gcc into object files
Used by the linker to de-mangle C++ and Java symbols and to keep overloaded functions from clashing
Displays call graph profile data
A linker that combines a number of object and archive files into a single file, relocating their data and tying up symbol references
Lists the symbols occurring in a given object file
Translates one type of object file into another
Displays information about the given object file, with options controlling the particular information to display; the information shown is useful to programmers who are working on the compilation tools
Generates an index of the contents of an archive and stores it in the archive; the index lists all of the symbols defined by archive members that are relocatable object files
Displays information about ELF type binaries
Lists the section sizes and the total size for the given object files
Outputs, for each given file, the sequences of printable characters that are of at least the specified length (defaulting to four); for object files, it prints, by default, only the strings from the initializing and loading sections while for other types of files, it scans the entire file
Discards symbols from object files
Contains routines used by various GNU programs, including getopt, obstack, strerror, strtol, and strtoul
The Binary File Descriptor library
A library for dealing with opcodes—the “readable text” versions of instructions for the processor; it is used for building utilities like objdump.