[Mapserver-dev] Re: [Mapserver-users] PHP Mapscript Problem

Daniel Morissette morissette at dmsolutions.ca
Wed Mar 26 15:56:12 EST 2003


Paul Ramsey wrote:
> 
> Yes, the moral of the story is: mapserver apps and mapscript libraries are
> STATICALLY LINKED against libmap. So it is not only possible but very easy to
> have a mapserv executable which is a different version than a mapscript
> library. This is not the first time this quirk has bitten us in the bum.
> 

Let's take this discussion to mapserver-dev...

I wish there could be an easier way to upgrade, but unfortunately I
don't think dynamic linking is the solution.  In this specific case,
Chris would have run into the same issue even with dynamic linking: his
mapserv could have been linked against libmap.so.3.6.4 and the
php_mapscript linked against libmap.so.3.6.1 for instance... even when
you install a new libmap.so.3.6.5, your old binaries still point to the
older version of the shared object file.  This is assuming that proper
versioning (the way I understand it) is applied to the .so files, e.g.

  /usr/local/lib:  libmap.so.3.6.1
                   libmap.so.3.6.4
                   libmap.so.3.6.5
                   libmap.so.3.6 -> libmap.so.3.6.5
                   libmap.so -> libmap.so.3.6.5

My understanding is that when you link against libmap.so above, the
linker actually remembers the reference to libmap.so.3.6.5.  This is
what allows you to maintain different versions of the same library on
your system without breaking older executables.  (And this is why in
Chris' situation that wouldn't have helped)

The other option would be to not use the version information and just
place a plain libmap.so in /usr/local/lib, a bit like libgdal.1.1.so
does.  I suspect that this is what you are hoping for, but unfortunately
this doesn't work well for GDAL, and wouldn't work well for libmap.so
either because the interface of both libs change too often.  95% of the
time, upgrading the .so files would imply that you have to recompile all
executables on your system that use libmap.so otherwise you would either
get crashes or undefined symbols at runtime.  (If you upgrade GDAL
regularily, you have run into that already I'm sure)  At least with the
static linking, older executables continue to work after you upgrade
MapServer, you just need to remember to recompile every executable that
you have installed.


Anyway, this is the way I understand shared objects and the impact they
would have if we started using them with MapServer.  That's why I'm not
very keen to switching to using a libmap.so, but I'm open to being
convinced otherwise.

Daniel
-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------




More information about the mapserver-dev mailing list