guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Use of ltdl "convenience library"


From: Bill Gribble
Subject: Use of ltdl "convenience library"
Date: 04 Nov 2001 13:40:34 -0600

Rob Browning pointed out to me recently that guile-1.5.4 uses the
libtool "convenience library" form of libltdl.  This means that ltdl.c
is compiled and linked directly into libguile to provide dynamic linking
of guile modules. 

This is nice because it prevents compile-time and runtime dependencies
on a user-installed version of libltdl.  However, there is a problem
which is pointed out in the libtool docs and which at least one
guile-using program (gnucash) has run into:

> One advantage of the convenience library is that it is not 
> installed, so the fact that you use libltdl will not be apparent
> to the user, and it will not overwrite a pre-installed version of
> libltdl a user might have.  On the other hand, if you want to upgrade
> libltdl for any reason (e.g. a bugfix) you'll have to recompile your 
> package instead of just replacing an installed version of libltdl. 
> However, if your programs or libraries are linked with other 
> libraries that use such a pre-installed version of libltdl, you 
> may get linker errors or run-time crashes. 

gnucash is linked against a pre-installed version of libltdl, because it
needs to dynamically open shared libraries for its own purposes.  We
have seen numerous run-time crashes inside lt_dlopen which we have been
unable to otherwise explain.  I cannot point the finger at guile's use
of the ltdl convenience library with absolute conviction.  I can say
that consideration of the libtool guidelines as to when it is
appropriate to use the convenience library indicates that guile probably
should not be using it. 

The guideline for when to use the convenience version of libltdl is
this:

> In general you can safely use the convenience library in
> programs which don't depend on other libraries that might 
> use libltdl too. 

So guile's use of the convenience library embodies an assumption about
programs which use guile: that they will not use libltdl except through
guile's wrapper (dynamic-link and friends). 

It seems like this is a bad assumption for guile to make, since it is
intended to be used as an extension language for many different kinds of
programs and not to put a priori restrictions on what they can do. 
Especially when those restrictions are not documented. 

I would suggest that prior to the guile-1.6 release the use of the
convenience ltdl library be removed, instead depending on an installed
version of libltdl. 

Thanks,
Bill Gribble





reply via email to

[Prev in Thread] Current Thread [Next in Thread]