Build and Install binutils from source

Do not miss this exclusive book on Binary Tree Problems. Get it now for free.

In this article, we have explored the steps to build Binutils from source code. With this, you can install any version of binutils and even try custom changes.

Table of contents:

  1. Step 1: Get source code of binutils
  2. Step 2: Configure binutils
  3. Step 3: Build and install binutils
  4. Summary of commands

Step 1: Get source code of binutils

git clone git://sourceware.org/git/binutils-gdb.git

OR

https://github.com/bminor/binutils-gdb.git

Once cloned, go into the source code:

cd binutils-gdb

Step 2: Configure binutils

CC=gcc ./configure

Step 3: Build and install binutils

make install

This will directly install binutils in default location such as /usr/local/bin, /usr/local/lib and others. This is the preferred way to make the newly built binutils available to the entire system.

To install it in your custom location, use the following command:

make

Summary of commands

The summary is as follows:

https://github.com/bminor/binutils-gdb.git
cd binutils-gdb
CC=gcc ./configure
make install

Once installed, check the version of binutils using one of the commands mentioned in this resource.

With this article at OpenGenus, you must be able to install any version of binutils and even, try your custom binutils changes.

Sign up for FREE 3 months of Amazon Music. YOU MUST NOT MISS.