Building busybox-w32

Building binaries from the busybox-w32 source is fairly straightforward. There are, though, a number of variables to complicate matters:

Instructions are provided here for some common combinations.

Cross-compiling on Linux

I do most of my work on Fedora Linux. This requires installing some packages from the standard Fedora repositories. The following command should cover everything needed for the i686/x86_64 architectures, MSVCRT runtime and gcc compiler:

   dnf install gcc make ncurses-devel perl-Pod-Html mingw32-gcc mingw64-gcc
From the top-level busybox-w32 source directory use one of these commands to configure the build: In either case run make -j $(nproc) to execute the build process.

Currently building for Windows on ARM (aarch64) requires the use of the clang compiler. Fedora doesn't have a package for this. Instead:

Configure the build with make mingw64a_defconfig and execute with make -j $(nproc).

Compiling on Microsoft Windows

For the i686/x86_64 architectures, MSVCRT runtime and gcc compiler the best toolchain for Windows is w64devkit. Download either the standard or i686 zip file and extract it somewhere. Running w64devkit.exe from the w64devkit directory will start a console window with a suitably configured busybox-w32 shell. From here the instructions are the same as for Linux:

From the top-level busybox-w32 source directory use one of these commands to configure the build:

In either case run make -j $(nproc) to execute the build process.

Currently building for Windows on ARM (aarch64) requires the use of the clang compiler. w64devkit doesn't support this. Instead:

Configure the build with mingw32-make mingw64a_defconfig and execute with mingw32-make -j $(nproc). Note the name of the make command to use.

Variations

There are any number of ways to vary the basic build procedures described above.


Ron Yorston
21st February 2024