How to cross compile Busybox

BusyBox combines tiny versions of many common UNIX utilities / commands into a single small executable. It provides minimalist replacements for most of the utilities you usually find in GNU coreutils, util-linux, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins.

Following steps helps to cross compile Busybox to a shared executable and also static executable.

Configuration of Busybox ( Dynamic Executable )

$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig

If you want to keep everything as default, ( By default busybox create dynamic executable ) then, after you run above command it will open a screen, on which navigate to Exit and click “Yes” when asked as below.

Busybox Menuconfig

This creates a file called “.config”

Configuration of Busybox ( Static Executable )

If you want to create static executable for busybox, so that it can run on any platform ( architecture specific ) independent of libraries, you need to change in menuconfig to select to build as static executable as below,

In menuconfig, Select “Busybox Settings”

Busybox Menuconfig

From settings, Select “Build Busybox as a static binary” as below.

Related :   Understanding sections header of ARM ELF binary file
Static Busybox

Compilation of Busybox

For compilation for Dynamic Busybox, once you have configured as above, enter below command to compile.

$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

This creates the “busybox” executable

Installation of Busybox

By default Busybox create “./install” directory where your source code is OR you can change the install directory as below,

$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- install

Changing install directory from command line,

$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- CONFIG_PREFIX=/path/from/root install

Changing install directory from menuconfig from “Busybox Settings”

Busybox Install

When Dynamically compiled (This is default compilation)

$ file _install/bin/busybox
_install/bin/busybox: ELF 64-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-, for GNU/Linux 3.2.0, BuildID[sha1]=d16cca32c42da434b296c84f6254e67490a109c5, stripped

When Statically compiled:

If you want to clean the compilation and delete every binaries generated, you can use below command

$ make clean

CLEAN applets
CLEAN busybox busybox_unstripped.out busybox_unstripped .kernelrelease

Note: you can also download toolchain from

$ wget -c
$ tar xvf gcc-linaro-arm-none-eabi-4.9-2014.09_linux.tar.bz2
$ tar xvf gcc-linaro-arm-none-eabi-4.9-2014.09_linux.tar.bz2
$ export PATH=$PATH:$PWD/gcc-linaro-arm-none-eabi-4.9-2014.09_linux/bin


Subscribe with Valid Email Id to receive updates in Inbox. ( Secured by Google FeedBurner )


Leave a Comment

Android Android Applications Android Build system Android Commands Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development & Build Development, Debugging and Performance Tools Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia Audio, Video, Images NDK / Middleware / HAL OS Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web design and development Website Hosting Wordpress Yocto / Bitbake / Openembedded