Binary compatibility on Linux

Johannes Pfau nospam at example.com
Sat Nov 10 10:54:50 PST 2012


Am Sat, 10 Nov 2012 16:40:37 +0100
schrieb Jacob Carlborg <doob at me.com>:

> What's the best way to achieve binary compatibility on Linux? For 
> example, if I compile an application on, say Ubuntu 12.04, it will
> most likely not run on any older versions of Ubuntu but it will run
> on future versions.
> 
> My current approach to solve this is to compile the application in
> the oldest version of Ubuntu I can find, in this case 6.x. This is
> starting to get a bit problematic:
> 
> * The integration with VirtuaBox (I'm running Ubuntu as a guest) is 
> pretty bad
> * DMD won't run of out of the box, I need to compile it. This is also 
> making DVM basically useless
> * I can't clone the dlang repositories due to having a very old
> version of git installed
> * I can't compile git, I haven't investigated in why but probably due
> to the system is too old
> 
> Is there some compiler/linker flags I can use when building to make
> the executable compatibility with older versions of Linux?
> 
> Or is there a better way to solve this?
> 

crosstool-NG has a nice option "Oldest supported ABI" where you
can enter an old GLIBC version and the compiler will generate
executables compatible with this version (although it still uses a
recent glibc). I have no idea how this works, but that's the best
solution I have seen so far. (crosstool also has an option "Disable
symbols versioning" which completely disables versioning. quite cool).

Here are some links which might help:
http://sourceware.org/ml/libc-help/2011-04/msg00032.html
http://www.trevorpounds.com/blog/?tag=symbol-versioning


More information about the Digitalmars-d mailing list