[fpc-pascal] linux: should we hard-code versioned or
unversioned shared libraries in our apps?
Marco van de Voort
marcov at stack.nl
Wed Aug 15 15:55:23 CEST 2012
In our previous episode, Graeme Geldenhuys said:
> > You said that you manually created the symbolic link. I simply explained that you should
> > never do that, and instead install the development packages because they will do that
> > (correctly) for you.
> So my applications that I deploy to clients will now require -devel
> packages? This just doesn't sound sane, sorry. Maybe there is just a
> fundamental flaw in all distros and how they package software.
No. It all works fine WITHIN a distribution (in a particular version). And
basically that is the only supported way on Linux.
Anything crossdistribution and cross-distroversion is assumed to be on
source level, not binary level (IOW rebuild your app). According to common
linux philosophy distributing crossdistro binaries is asking for pain.
Basically if you link to a .so the normal way, to simplify build systems, a
symlink from a generic name to a versioned name is used. But the generic
binary contains a reference to the versioned name, and thus will work
without symlink, which is why end-users systems don't have the link.
But this way of linking is more dependent on the exact version of the
library, so in the past some people changed everything to dynamically
loaded via dlload/dlsym.
This alleviates the versioning problem somewhat, but discards the
only distribution provided way to fix this.
I still think that changing everything to _dyn created more problems than
it solved. (except for special disaster case mysql maybe)
More information about the fpc-pascal