Open-Source Internship opportunity by OpenGenus for programmers. Apply now.
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:
- Step 1: Get source code of binutils
- Step 2: Configure binutils
- Step 3: Build and install binutils
- 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.