Obtaining an ARMv4 Toolchain

Since I sometimes work on technology considered antique, I need ARMv4 toolchains for systems such as the Gemini or Integrator AP/CP

This is for userspace, even a tiny InitramFS using just BusyBox will need a proper toolchain linked to some fairly recent Linux UAPI headers. For compiling just the kernel or U-Boot you can just use the latest Linaro GCC toolchain since the kernel does not utilize libgcc.a and other glibc parts of the toolchain, neither does U-Boot these days.

Getting a proper cross compiler for ARMv4 can be tricky.

Toolchain from Aboriginal

I used to just use Rob Landleys precompiled ARMv4TL (ARMv4 Thumb Little-Endian) compiler for the Integrator U-Boot and userspace rootfs compilation. Presumably you can use the plain ARMv4L version as well, and if you mounted core module is ARMv5 or ARMv6 or whatever you can use the other compiler variants in Rob's download directory. Just unpack the toolchain and make sure the /bin subdir is added to your $PATH and you are ready to go.

The problem is that Rob's project is decomissioned.

Using OpenEmbeddeds Toolchain

Recently I have been building my ARMv4 toolchains using OpenEmbedded. This gives you a GCC 7.2.0 or later toolchain as of writing. This is the simplified procedure:

I haven't had any major problems with this toolchain, it works great and uses very recent kernel APIs. The target C library is in oecore-x86_64-armv4-toolchain-nodistro/sysroots/armv4-oe-linux-gnueabi and as it is modern, all you need to do to get compilation working is to pass the magical --sysroot=/var/linus/oecore-x86_64-armv4-toolchain-nodistro/sysroots/armv4-oe-linux-gnueabi parameter to the compiler and linker (CFLAGS and LDFLAGS respectively) and all just works.

Prebuilt OE Toolchain

Unpack with bunzip2, then run to install.