unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: rm@fabula.de
Cc: Greg Troxel <gdt@ir.bbn.com>, guile-user@gnu.org
Subject: Re: 1.6.0 problems with libguilereadline-v-12 and fix
Date: Thu, 19 Sep 2002 12:03:33 +0200	[thread overview]
Message-ID: <20020919100333.GB7220@www> (raw)
In-Reply-To: <87sn06ek95.fsf@raven.i.defaultvalue.org>

On Wed, Sep 18, 2002 at 10:22:30PM -0500, Rob Browning wrote:
> prj@po.cwru.edu (Paul Jarc) writes:
> 
> > By "temporarily", I meant that the modification should be undone
> > after linking the library.  Would this problem still remain then?
> 
> Hmm, that's an interesting idea.  It might be shaky in the presence of
> threads, but I'm not sure that's something we're aiming to accomodate.
> It would also prevent users from controlling things via their normal
> envt, vars, but perhaps that's not critical either.  It's definitely
> better than what I had been thinking in that direction.

May i point at similar sugestions i posted a while ago ;-)
Libltdl does provide API calls to modify the search path at runtime.
Why don't we extend dynamic linking like this:

static void *
sysdep_dynl_link (const char *fname, const char *subr)
{
  lt_dlhandle  handle;
  const char  *orig_path;
  const char  *guile_libdir = SCM_PKGLIB_DIR "/lib"

  /* save original search path */
  orig_path = lt_dlgetsearchpath();

  /* modify for guile usage - 
   * NOTE: we might want to _prepend_ here instead of just adding,
   * this would require some string operations and a call to
   * 'lt_dlsetsearchpath()' instead the following ...
   */
  void lt_dladdsearchdir(guile_libdir);

  handle = lt_dlopenext (fname);
  if (NULL == handle)
    {
      SCM fn;
      SCM msg;

      fn = scm_makfrom0str (fname);
      msg = scm_makfrom0str (lt_dlerror ());
      scm_misc_error (subr, "file: ~S, message: ~S", scm_list_2 (fn, msg));
    }

  /* restore original search path */
  void lt_dlsetsearchpath(orig_path);
  return (void *) handle;
}

A few remarks  (even so i might repeat myself):

 - Multithreading: libltdl _does_ provide a mutex framework - iff we
   need threadsave dynamic linking we "just" need to implement the 
   mutex/locking code (BTW, i don't see where this is different from the
   current aproach - we need to have mutexes too [see the comment at the
   beginning of file 'dynl.c']).

 - Putting things in a standard place, or, like Marius phrased it:
   "The right thing is to configure your system so that the installed 
    libraries are visible to all programs, in the standard way."
   I can't agree here -- those standard places are meant for libraries
   that can and will be shared by many different applications. Object
   code like guilereadline.so isn't meant to be of any use to non-guile
   applications (and in the few cases an application really needs to
   dynamiclly link against such objects we should assume that the programmer
   knew what she is doing and expect her to add our guile specific library
   location(s) to the search path). I think one can reduce this discussion
   to the question: "what's the true nature of code linked dynamically 
   from guile - is it a normal shared library or is it rather a 'plug-in'
   meant to extend an application?" I tend to favour the second view.
   Looking at other interpreters (shudder): both perl and python (as 
   well as some more esotheric languages) have their "private" library
   space.

> However, I guess at the moment, since we have the issue documented in
> the INSTALL file, I'm tempted to leave things alone until we can
> hopefully figure out a more general solution (during the 1.7
> development cycle), and then only change things once.

I don't really see what the solution i suggested would break that
wouldn't break with the solution mentioned in the INSTALL file. 
Modifying the environment will affect the linking behaviour of the
application as a whole _and_ will change the linking behaviour of all
child processes -- not really an option for many uses.

> Marius has suggested that perhaps the right thing to do is discuss
> this with the libltdl people and see if we can settle on a more
> general solution, one that might also involve a versioned lt_dlopen.
> I'm inclined in that direction as well.

Yes, i think this is a good idea (and, given the number of problem reports
in this list alone, probably needs to be done soon).

  Ralf Mattes


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


  parent reply	other threads:[~2002-09-19 10:03 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-18 20:33 1.6.0 problems with libguilereadline-v-12 and fix Greg Troxel
2002-09-18 21:14 ` Marius Vollmer
2002-09-18 21:53   ` Paul Jarc
2002-09-18 22:40     ` Rob Browning
2002-09-18 22:43       ` Paul Jarc
2002-09-19  3:22         ` Rob Browning
2002-09-19  4:13           ` Robert Uhl <ruhl@4dv.net>
2002-09-19 10:03           ` rm [this message]
2002-09-19 15:02             ` Rob Browning
2002-09-19 15:18               ` Paul Jarc
2002-09-19 15:27               ` rm
2002-09-19 18:29                 ` Rob Browning
2002-10-03 16:03                 ` Marius Vollmer
2002-10-03 15:56             ` Marius Vollmer
2002-10-03 17:22               ` Paul Jarc
2002-10-04 11:58                 ` Marius Vollmer
2002-10-03 19:19               ` tomas
2002-10-04 12:04                 ` Marius Vollmer
2002-10-04 13:04                   ` rm
2002-10-08 21:16                     ` Marius Vollmer
2002-10-08 21:54                       ` Dale P. Smith
2002-10-09  6:47                       ` tomas
2002-09-19 10:11           ` rm
2002-09-19 15:10           ` Paul Jarc
2002-09-19 21:21           ` Neil Jerram
2002-09-19 22:06             ` Rob Browning
2002-09-19 22:17               ` Paul Jarc
2002-09-19 23:13                 ` Rob Browning
2002-09-19  4:02         ` Thien-Thi Nguyen
2002-09-19 16:17           ` Paul Jarc
2002-09-19 18:52             ` Thien-Thi Nguyen
2002-09-19 19:33               ` Paul Jarc
2002-09-19 19:58                 ` Thien-Thi Nguyen
2002-09-19 22:17                   ` Thien-Thi Nguyen
2002-09-20  1:28                     ` Thien-Thi Nguyen
2002-09-20 15:45                       ` Paul Jarc
2002-10-03 15:38     ` Marius Vollmer
2002-10-04 16:43       ` Paul Jarc
2002-10-08 21:26         ` Marius Vollmer
2002-10-08 21:38           ` Paul Jarc
2002-10-08 22:47             ` Marius Vollmer
2002-10-09  4:34               ` Paul Jarc
2002-10-09  6:51               ` tomas
2002-09-19 13:17   ` Arno Peters
2002-09-19 14:07     ` Rob Browning
2002-10-03 16:06     ` Marius Vollmer
2002-10-03 19:44       ` Rob Browning
2002-09-19 13:43   ` Greg Troxel
2002-09-19 14:53     ` Rob Browning
2002-09-19 15:57       ` Paul Jarc
2002-09-19 18:47         ` Rob Browning
2002-09-19 19:32           ` Paul Jarc
2002-09-19 21:07             ` Rob Browning
2002-09-20 11:47       ` Greg Troxel
2002-09-20 12:04       ` Greg Troxel
2002-09-20 15:23         ` Rob Browning
2002-09-20 22:47           ` Paul Jarc
2002-09-21  3:00             ` Rob Browning
2002-09-21 15:46             ` Robert Uhl <ruhl@4dv.net>
2002-09-21 21:45               ` Paul Jarc
2002-09-23  4:35                 ` Robert Uhl <ruhl@4dv.net>
2002-09-23 15:47                   ` Paul Jarc
2002-09-23 19:20                     ` Robert Uhl <ruhl@4dv.net>
2002-09-23 20:06                       ` Paul Jarc
2002-09-23 21:29                         ` Eric E Moore
2002-09-23 21:37                           ` Paul Jarc
2002-09-20 17:59         ` Rob Browning
2002-09-20 21:32           ` Paul Jarc
2002-09-20 20:27         ` Paul Jarc
2002-09-20 20:42         ` Thien-Thi Nguyen
2002-09-20 21:16           ` Paul Jarc
2002-09-20 21:43             ` Paul Jarc
2002-09-21  1:56             ` Thien-Thi Nguyen
2002-09-21 21:51               ` Paul Jarc
2002-09-25  6:09                 ` Thien-Thi Nguyen
2002-09-22 18:52         ` Gary Houston
2002-09-23  1:50           ` Rob Browning
2002-10-03 16:33           ` Marius Vollmer
2002-10-03 17:51         ` Marius Vollmer
2002-10-03 17:37     ` Marius Vollmer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020919100333.GB7220@www \
    --to=rm@fabula.de \
    --cc=gdt@ir.bbn.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).