ABI backward-compatibility is the trick...
ABI backward-compatibility is the trick...
Posted Nov 30, 2010 22:15 UTC (Tue) by lindahl (guest, #15266)In reply to: ABI backward-compatibility is the trick... by madscientist
Parent article: The kernel and the C library as a single project
Posted Nov 30, 2010 22:42 UTC (Tue)
by madscientist (subscriber, #16861)
[Link] (7 responses)
Obviously if you invoke system calls directly then you have to deal with this, but that's not relevant to whether libc comes with the kernel or not.
Posted Nov 30, 2010 22:56 UTC (Tue)
by khim (subscriber, #9252)
[Link] (3 responses)
This is good example: sched_setaffinity(2) had two arguments before 2.3.4. If you'll take the old program which uses this version - you'll be unable to compile it today. BUT! If you'll take binary of old version of program compiled with old version of GLibC - it'll run with new one just fine because today GLibC offers two interfaces of sched_setaffinity(2) and selects them automatically depending on what the calling program expects. GLibC maintains stable ABI - and it's very good at that (documented "undefined" behavior is exception, of course). Yet it does not maintain stable API! This experience is so alien compared to what other libraries are doing that it takes some time to wrap up the mind around the concept.
Posted Nov 30, 2010 23:21 UTC (Tue)
by madscientist (subscriber, #16861)
[Link]
API compatibility is a completely different animal: if you're going to use Linux-specific APIs then I suppose you just have to fix your code if they change in the future. If you don't want to do that, restrict yourself to POSIX and other standard APIs. I don't really worry about this, to be honest.
Posted Dec 1, 2010 10:57 UTC (Wed)
by Yorick (guest, #19241)
[Link]
Posted Dec 1, 2010 14:14 UTC (Wed)
by paulj (subscriber, #341)
[Link]
Further, even for the API, there are ways to offer multiple versions of those. You can categorise your APIs in various, including with levels. Applications can then *choose* to explicitly depend on certain APIs or they can choose not to and use whatever the default API is - some applications will do that through laziness or ignorance.
All boring and hard engineering work, but it's what widely deployed (in space and, especially, time) systems tend to have to acquire.
Posted Dec 1, 2010 7:32 UTC (Wed)
by steven676 (subscriber, #41893)
[Link] (2 responses)
Not unless you want to eliminate static linking and make upgrading your kernel a nightmare. (If the ABI the kernel exposes to libc isn't stable, then libc has to be updated with the kernel -- except that the kernel update isn't effective until reboot, while the libc update will be effective for newly launched programs immediately.)
Solaris has this problem, and "solves" it via a horrible hack called "deferred activation patching" -- basically bind mounting the old libraries over the new ones until reboot. (It's also why there's no static linking on Solaris >= 10.)
Posted Dec 1, 2010 14:13 UTC (Wed)
by madscientist (subscriber, #16861)
[Link]
On the other hand, it's pretty darn hard to link many types of programs statically even today.
Posted Dec 3, 2010 19:50 UTC (Fri)
by Spudd86 (subscriber, #51683)
[Link]
Basically API/ABI-wise nothing changes (at least not intentionally), except the speed at which new parts become useable.
ABI backward-compatibility is the trick...
He meant GLibC function, not syscall...
ABI == important; API == not so much...
As you note, the ABI stability only goes in one direction. Someone who wishes to distribute a binary that will work on systems of varying age will have to chose between:
He meant GLibC function, not syscall...
None of these solutions are perfect. In some ways, the Unix tradition of providing a "canonical" set of include and lib files in a prominent place, /usr, and a compiler that is configured to use these files by default, makes this harder than it would on a platform where development tools are installed separately and explicitly in a user-specified location.
He meant GLibC function, not syscall...
ABI backward-compatibility is the trick...
ABI backward-compatibility is the trick...
ABI backward-compatibility is the trick...