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.
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.
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:
MACHINE ?= "qemuarm"
export PATH=/usr/bin:/usr/sbin source ./oe-init-build-env build-armv4-toolchain bitbake meta-toolchain
$ ./oecore-x86_64-armv4-toolchain-nodistro.0.sh OpenEmbedded SDK installer version nodistro.0 ============================================= Enter target directory for SDK (default: /usr/local/oecore-x86_64): /var/linus/oecore-x86_64-armv4-toolchain-nodistro You are about to install the SDK to "/var/linus/oecore-x86_64-armv4-toolchain-nodistro". Proceed[Y/n]? Y Extracting SDK.....................done Setting it up...done SDK has been successfully set up and is ready to be used. Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g. $ . /var/linus/oecore-x86_64-armv4-toolchain-nodistro/environment-setup-armv4-oe-linux-gnueabi
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.
Unpack with bunzip2, then run to install.