33

In a discussion on backwards-compatibility in Linux kernel and GUI ABIs, Alan Cox notes that "my 3.6rc kernel will still run a Rogue binary built in 1992. X is back compatible to apps far older than Linux."

So just how backwards-compatible are the Linux Application binary interfaces?

What is the oldest binary executable, actually written and compiled years ago, that will still run on a modern stock general-purpose Linux distribution?

I'm sure all those words are subject to interpretation. My main notion is that it is not fair to run it via an emulator or specialized virtual machine or binary translator, but some such things are probably built into some modern distros, and learning about that is part of the fun here.

Variations by hardware architecture, executable file format, language, and major library dynamic loading dependencies are also of interest.

Note, when the rules are relaxed, here's one example of going further back. The 2002 web page Running a.out executables on modern Red Hat Linux talks about using really old Linux pre-ELF a.out-format executables after doing modprobe binfmt_aout and obtaining /lib/ld.so and libc.so.4 Again that's of peripheral interest for this question, but illustrates the sorts of things that can be involved when digging further back.

Update for you BSD fans, it's great to see that iBCS2 was supporting old Xenix apps (like zork/dungeon-2.5.6 from 1990) and SCO OpenServer 5.0.x apps as recently as NetBSD 4.0.1 (from 2008): iBCS2 & NetBSD | Fun with virtualization. But the same thing seems broken in NetBSD 5.0.x.

Update 2: One year later, after even getting an "Announcer" badge for this question, I'm still looking for an answer. And to clarify, since this is about APIs, it should be a "real" binary (non-zero length), that still at least mostly works in the original way.

muru
  • 72,889
nealmcb
  • 796
  • 9
  • 16

2 Answers2

10

I think that /bin/true has to be the oldest working ..

Well, can you call a zero-byte file a binary?

touch /tmp/old_true
chmod 755 /tmp/old_true
/tmp/old_true
echo $?
nealmcb
  • 796
  • 9
  • 16
  • 1
    Cute. Do you know if /bin/true has been distributed as a zero-length file, and if so when and where? For grins, see Solaris /bin/true - TDWTF Forums – nealmcb Sep 18 '12 at 03:07
  • 3
    @nealmcb -- There was a 0-byte program called go.com for both CP/M and DOS that would rerun the last COM file loaded. So, it was even sold. So, in fact, it predates Linux. It just changed what it did when it jumped platform. Talk about backwards compatibility! We have a CP/M, DOS and *nix program all running at once. – Jeremy J Starcher Sep 18 '12 at 03:15
  • What an odd behavior - run the last COM file.... Anyway, I'm still looking for a "real" binary (non-zero length), that still at least mostly works in the original way. – nealmcb Sep 28 '13 at 14:37
  • interestingly this works in a POSIX shell and csh, but it fails in zsh: zsh: exec format error – Marco Sep 30 '13 at 20:44
  • Just for clarification, while I love this side-discussion, I don't consider this a valid answer, since it wasn't "actually written and compiled years ago". I'm asking about ABI compatibility. – nealmcb Oct 03 '13 at 15:17
2

So just how backwards-compatible are the Linux Application binary interfaces?

You can look at the analysis report for the Linux kernel ABI here (2.6.36-4.4.5 versions):

enter image description here

The same report you can find for several Linux base libraries on this page (Glibc, Qt, cairo, ...). The backward binary compatibility is estimated for each release in percents, so you can make conclusion on overall ABI compatibility for each library:

enter image description here

Much more reports for about 700 Linux libraries you can find on the upstream.rosalinux.ru. This resource is not supported anymore (use abi-tracker instead), but you can look at the reports for the old releases of libraries.

  • 2
    The internal "kernel ABI" says nothing about backward compatibility of binary applications running on linux. At most, it says something about backward source compatibility of kernel modules. I think there are safeguards in place to prevent you from loading modules compiled for a different kernel version. – DepressedDaniel Mar 27 '17 at 14:44