On 15 Dec 2013 20:57:00 GMT
Jorgen Grahn <
grahn...@snipabacken.se> wrote:
> On Sun, 2013-12-15, Geoff wrote:
> > On Sun, 15 Dec 2013 09:31:17 -0800 (PST),
woodb...@gmail.com
> > wrote:
> ...
> >>Then I copied the Debian-built files to a Fedora machine
> >>where I had originally encountered the problem. The
> >>problem still occurred on Fedora. The Fedora machine
> >>has an alpha or beta version of Fedora on it and my
> >>guess is it has a TCP related bug.
>
> > Generally speaking, it's a Bad Idea(tm) to copy binaries from one
> > edition of Linux (Debian) to another (Fedora). The results are
> > unpredictable since they may not share a common ABI.
>
> Are you reasonably sure about that? Any references?
>
> The main burden of keeping things sane lies on the library writers.
> When an incompatible version of e.g. the Gnu libc comes out, they must
> step the .so file's revision number. (Somehow. The details are
> unclear to me.) Then your program will fail to run unless the right
> version of libc is available.
libtool does all that for you, assuming the library concerned uses
libtool (as most do), in combination with the -version-info link flag.
> It's possible that Fedora takes libfoo version X from upstream and
> modifies it so it's not compatible with the Debian build of libfoo
> version X ... or modifies the compiler so that it generates such an
> incompatibility. But that seems to me rather unlikely since it means
> messing with the rather delicate upstream ABI decisions. If you're
> Fedora, your can only switch ABIs when the upstream does it, and then
> you're stuck with that decision until they release libfoo version X+1.
> > Instead, you should copy your sources over and build your projects
> > on each platform. This is why package management exists.
>
> I agree that is the sane and normal way of doing it. And yes, that
> also means I'm not sure you are wrong.
You are asking for trouble if you don't rebuild for different linux
distributions.
Not all libraries use libtool versioning and not all libraries are
adequately strict about keeping binary compatibility between versions
with the same libtool version number even where they do. With C++
libraries it can be extremely difficult to know when you are breaking
binary compatibility for a particular compiler, and breaking of the ODR
rule for inline C++ functions is commonplace - in most cases this
doesn't matter, but depending on the linker it might. (Every time you
modify an inline function in a library header you risk breaking the ODR
rule unless all code which includes the header is rebuilt: but in most
cases this breach is technical only and distributions will not rebuild
for this.)
Furthermore, even those projects which correctly maintain binary
compatibility between major releases only guarantee compatibility going
from lower to higher version numbers, and not the reverse (there is no
inhibition on adding adding new symbols with later versions - the
inhibition is on removing symbols). So if you try to use a binary
compiled with one distribution on another, and the other uses an
earlier version of a particular library, you might be stuffed for that
reason.
Not all distributions even use the same libc (fedora uses glibc, ubuntu
and debian use eglibc).
Distributions will rebuild when they need to, not when other
distributions need to. In addition, some distributions use patched
versions of libraries which might conceivably differ in binary
compatibilty from the unpatched upstream version (which is fine for the
distribution concerned).
You will minimise the risk of trouble of course if you do static
builds. However, not all libraries will build statically (the GTK+
tool chain found on ubuntu and fedora will not).
Chris