[Mono-devel-list] Proposal: Library Loading

Ferdinand Prantl ferdinand.prantl at ixos.de
Wed Apr 14 08:29:20 EDT 2004


Hi Jon, 

> From: Jonathan Pryor [mailto:jonpryor at vt.edu] 
> On Wed, 2004-04-14 at 01:31, Miguel de Icaza wrote:
> I don't think this will work as-is.  I'll detail below.
> 
> > For example, Gtk# would install something like this:
> > 
> > <configuration>
> > 	<dllmap dll="libglib-2.0-0.dll" 
> target="libglib-2.0.so.0.200.3" /> 
> > </configuration>
> > 
> > Notice that the full version for the .so file is specified on the 
> > .libmap file.
> 
> And this is the problem: the full version is specified.  If 
> no further intelligence is present, then I won't be able to 
> use Gtk# anymore, as I have libglib-2.0.so.0.200.2 installed. 
>  Since the version numbers don't match exactly (and mine has 
> a lower patch number), dlopen(3) won't be able to find the 
> library, so I won't be able to run my programs anymore.

Yes, and the same can happen in the world of legacy dlls - the application
should not link to the exact version of a library.
It should believe the rule, that the author maintains the versioning numbers
to express the backward compatibility, not announcing a new version with a
new number every year... :-)

Thus, instead of

  <dllmap dll="libglib-2.0-0.dll" target="libglib-2.0.so.0.200.3" />

one should generally use

  <dllmap dll="libglib-2.0-0.dll" target="libglib-2.0.so.0" />

It will handle the dependencies just like the native linker and loader -
here for example by going from the least specific symlink to the most one.
However, there is still the possibilty to specify the version exactly, if it
is necessary for some reason.

Ferda



More information about the Mono-devel-list mailing list