Re: How to develop a random number generation device



Nobody wrote:
On Wed, 12 Sep 2007 23:46:24 +0200, David Brown wrote:

If you try to run a 5-year old Linux binary on a current distribution,
you'll probably find that a lot of the interfaces on which it depends have
either disappeared or have changed in an incompatible manner. Lack of a
stable ABI is a simple fact of life on Linux.
Binary compatibility for the user-level API is extremely important for Linux, and the API is very stable - new API's and system calls are added, but existing ones are seldom changed or removed, and never without very good reason.

That's only really true for "core" libraries, e.g. libc. Once you get up
to higher levels (e.g. X and GUI toolkits), the ABIs can change quite
frequently.


To be a little pedantic, things like X and gui toolkits are not part of Linux - the comment was about the Linux API (and I presume you mean "API", not "ABI" - i.e., the interface for calling system functions from languages like C, rather than the low-level specification for C function calling conventions).

But more generally, the situation is fairly similar with these sorts of libraries - they get extended, but there are not often major incompatible changes. What changes is often catered by the standard "./configure" process, and when necessary Linux installations have copies of the various versions of the libraries.

Anything which uses C++ tends to be especially fragile, partly due to
extensive use of structures (objects), partly due to the amount of inlined
code (which often relies upon structure layout and won't change along with
non-inlined functions in the library).


I'm not sure how valid that is - but it's also worth remembering that in the world of open source, source code compatibility is more important than binary compatibility. A great many binary incompatibilities can be resolved by a simple recompile - standard practice when making a new version of a Linux distribution, but alien to the world of windows programming.

Most five year old Linux binaries will run fine on the same architecture as they were build for (assuming you have the right libraries)

IOW, a five year old binary will run on a five year old OS distribution.
If you want to run it on a newer distribution, you need to start chasing
down all of the five-years-ago versions of the libraries that it uses.


In the cases where that is necessary, distributions often have these five year old libraries in their repositories.

- the only API calls that have changed are very seldom used.

It isn't so much the syntax of the calls (even a fairly slack programmer
can figure out that changing the argument list will change the API), but
the structures which they use (and, less frequently, their semantics).


Again, structures often have members added - but seldom removed or changed. In this case, a recompile will be a simple fix. Windows APIs often include the size of structures as part of their parameters (or as a field in the structure itself), so that code can take into account varying sizes for different versions of windows (newer versions add to the end of the structures). This allows better binary compatibility, at the cost of run-time overhead (space needs to be allocated dynamically rather than statically).

I have never heard of changing user-level binary API interfaces being a serious problem on Linux (it is viewed by some to be a serious problem at the device driver level, but mainly by people who simply don't understand Linux), but I suppose it might be for some types of software.
.



Relevant Pages

  • Re: Significant Pure Assembler Application In MASM ?
    ... When I was thinking of a literal "port" of RosAsm for LuxAsm, I was quite daunted by this!!! ... I was seeing a lot of APIs that, I'm not sure what they do, but I don't think there's a Linux equivalent. ... I was contemplating *avoiding* libraries for LuxAsm, ... If GTK is a "replacement od the Win Api", ...
    (alt.lang.asm)
  • Re: TIs MSP430-F2013 USB DevKit & mspgcc
    ... There is an equivalent msp430.so for Linux. ... You could talk gdb remote protocol to the existing ... Get the API for the ddebugger unit in the core and write ...
    (comp.arch.embedded)
  • Re: How to develop a random number generation device
    ... Binary compatibility for the user-level API is extremely important for ... and the API is very stable - new API's and system calls are ... That's only really true for "core" libraries, ... a five year old binary will run on a five year old OS distribution. ...
    (sci.electronics.design)
  • Re: WIMP programming under RISC OS and Windows
    ... backend for xwWidgets? ... I would draft up a spec for a set of libraries with a common API. ... run on Linux and similar systems on RISC OS. ...
    (comp.sys.acorn.programmer)
  • Re: Reading and processing midi events
    ... I would appreciate similar c++ libraries as well. ... MIDI on Linux is done via the ALSA MIDI API. ...
    (comp.music.midi)