As we all know, Mac OS X has support for what is called ‘fat binaries’. These are binaries that can carry code for for instance multiple architectures – in the case of the Mac, PowerPC and x86. Ryan Gordon was working on an implementation of fat binaries for Linux – but due to the conduct of the Linux maintainers, Gordon has halted the effort.
The project was called FatELF, and was in quite and advanced state already; in fact, a full FatELF version of Ubuntu 9.04 can be downloaded from the project’s website.
The format is very simple: it adds some accounting info at the start of the file, and then appends all the ELF binaries after it, adding padding for alignment. The end of the file isn’t touched, so you can still do things like self-extracting .zip files for multiple architectures with FatELF.
FatELF lets you pack binaries into one file, seperated by OS ABI, OS ABI version, byte order and word size, and most importantly, CPU architecture.
This approach to binaries has a lot of benefits. For instance, distributors could ship a single DVD which would work on all architectures the distribution in question supports, making it easier for users to pick the right .iso to download. It can even go a lot further; you could ship a binary which could work on noth Linux and FreeBSD out of the box.
It all sounds pretty darn impressive and a major step forward, but the Linux kernel maintainers “frowned upon” Gordon’s patches. “It looks like the Linux kernel maintainers are frowning on the FatELF patches,” he writes, “Some got the idea and disagreed, some didn’t seem to hear what I was saying, and some showed up just to be rude.”
He further detailed:
I didn’t really expect to be walking into the buzzsaw that I did. I imagined people would discuss the merits and flaws of the idea and we’d work towards an agreeable solution that improves Linux for everyone. It sure seemed to be going that way at first. Ultimately, I got hit over the head with package management, the bane of third-party development, as a panacea for everything.
After a while it sort of felt like no one was actually understanding a single thing I said. A lot of it felt like willful ignorance, but I suppose I’m biased.
Even if Gordon did get the kernel guys to agree to include his patches, the next hurdle would be glibc. Ulrich Drepper, glibc’s maintainer, isn’t particularly keen on the idea either. “It is a ‘solution’ which adds costs in many, many places for a problem that doesn’t exist,” Drepper states, “I don’t see why people even spend a second thinking about this.”
I’m actually quite sad Gordon is halting the FatELF project. It seems like a very worthwhile addition to the Linux world, and it could make the lives of distributors and users alike a lot easier.