User:Maffblaster/Drafts/GNU Binutils

From Gentoo Wiki
Jump to: navigation, search


Installation

USE flags

USE flags for sys-devel/binutils Tools necessary to build programs

cxx Build support for C++ (bindings, extra libraries, code generation, ...) global
multitarget Adds support to binutils for cross compiling (does not work with gas) local
nls Add Native Language Support (using gettext - GNU locale utilities) global
static-libs Build static versions of dynamic libraries as well global
test Workaround to pull in packages needed to run with FEATURES=test. Portage-2.1.2 handles this internally, so don't set it in make.conf/package.use anymore global

Emerge

root #emerge --ask sys-devel/binutils

Configuration

Select a newer version

Upon binutils package upgrades it is occasionally necessary to select a newer profile to be used for the system's toolchain. This can be done using the binutils-config command. First list known (installed) versions:

root #binutils-config --list-profiles
 [1] x86_64-pc-linux-gnu-2.25.1 *
 [2] x86_64-pc-linux-gnu-2.26.1

Select the newest profile. Either the integer number or the full profile name can be used to select the profile; below the profile name is used:

root #binutils-config x86_64-pc-linux-gnu-2.26.1
 * Switching to x86_64-pc-linux-gnu-2.26.1 ...                                                                                   [ ok ]

 * Please remember to run:

 *   # . /etc/profile

Usage

There are several command-line tools for binary manipulation distributed in binutils, each has its own expectation on acceptable options, arguments, and parameters. Covering them all goes beyond the scope of this article, however they may eventually be expounded upon in the future. See upstream documentation or the appropriate man page for usage on each utility.

Troubleshooting

Preserved-rebuild loop

When Portage is caught in a @preserved-rebuild loop and the only culprit failing is binutils, use the following steps to resolve the issue. First use the binutils-config command to select the latest emerged version. See Select a new version section above. After executing this step, return here and perform a --depclean:

root #emerge --ask --depclean

Finally perform a @preserved-rebuild a final time:

root #emerge --ask @preserved-rebuild

Removal

Generally speaking this collection of software tools should only have old versions removed by passing the --depclean option to emerge.

Unmerge

root #emerge --ask --depclean sys-devel/binutils

See also

  • Upgrading GCC - Gentoo's long-standing guide containing end-user instructions for upgrading GCC.