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

The ARMv4 Instruction Set Architecture (ISA) also referred to as "ARM8 family" which is a bit confusing. It is used in StrongARM and Faraday Seminconductors FA526 such as in Gemini or iPAQ.

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.

Using OpenWrt's Toolchain

Nowadays I find it easiest to just build OpenWrt and use as userspace, and it includes an ARMv4 toolchain that gets built with OpenWrt. There are build options in the menuconfig of OpenWrt to package and export the toolchain for your target, so if you select an ARMv4 target this will solve itself.

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.

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.