unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Vorfeed Canal <vorfeed.canal@gmail.com>
Subject: Re: Search path for C libraries
Date: Tue, 18 Oct 2005 14:12:56 +0400	[thread overview]
Message-ID: <6efab2350510180312r59e14d94he768ba03ac18a97b@mail.gmail.com> (raw)
In-Reply-To: <87mzl7grnd.fsf_-_@laas.fr>

On 10/18/05, Ludovic Courtès <ludovic.courtes@laas.fr> wrote:
> Hi,
>
> Greg Troxel <gdt@ir.bbn.com> writes:
>
> > Perhaps dynamic-link should look in guilelibdir _only_ if an absolute
> > path is not given, or a primitive that does this.  One important
> > feature is that inclusion, dynamic link, etc. should be able to ensure
> > it gets exactly what was searched for and tested at configure time.
>
> Right.  This is one of the concerns that was raised by Vorfeed Canal
> earlier I think.
>
Yup. This is EXACTLY why libltdl have search_path in first place. Of
course libltdl WILL NOT try to use this path if full path is given in
load-extension - this is all built in ltdl:
http://www.gnu.org/software/libtool/manual.html#Using-libltdl

In my patch I moved search_path to scheme level and when dynamic
loaded is used old ltdl search_path will be forgotten. Since guile is
designed to be used in big, complex programs perhaps its better to
save search path and then restore it. And this must be done under 
lt_dlmutex_lock/lt_dlmutex_unlock, obviously.

I left all this out of patch since this was proof-of-concept kinda
thing anyway and since before guile 1.8 release someone should do
something with this:

-- guile-1.7.2/libguile/dynl.c
/*
  From the libtool manual: "Note that libltdl is not threadsafe,
  i.e. a multithreaded application has to use a mutex for libltdl.".

  Guile does not currently support pre-emptive threads, so there is no
  mutex.  Previously SCM_CRITICAL_SECTION_START and
  SCM_CRITICAL_SECTION_END were used: they are mentioned here in case
  somebody is grepping for thread problems ;)
*/
-- cut --
Libtool manual does not say this anymore:
http://www.gnu.org/software/libtool/manual.html#Thread-Safety-in-libltdl
and guile DOES have support for pre-emptive threads now so it's good
idea to do something about this.

This is separate problem and there are not much to discuss: ltdl can
not be used in multi-threaded environment without
lt_dlmutex_lock/lt_dlmutex_unlock (it changes global variable
search-path internally, for example!) and while you can export ltdl's
variable to scheme level "as is" you'll be forced to export
LT_PATHSEP_CHAR as well and then every scheme module will be exposed
to gory details of OS dynamic loading mechanism (":" vs ";") so it all
will look quite ugly (barely better then current way of parsing and
changing of LD_LIBRARY_PATH/LTDL_LIBRARY_PATH).

> Maybe the right way to do this would in fact to have module developers
> generate the `dynamic-link' code at configure-time (using Autoconf
> substitution) in order to hard-wire the library path.

It can be done already, but most distribution's HOWTOs are quite vocal
about never using -rpath with C libraries - and this is the same
thing.

> Unfortunately, this isn't very elegant and it precludes, for instance, running the
> module's test suite before installing it (because `dynamic-link' would
> either fail or load the wrong library).

This is one reason, yes.


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


  reply	other threads:[~2005-10-18 10:12 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-13 18:21 Modified load-path proposal Neil Jerram
2005-10-13 18:40 ` Greg Troxel
2005-10-13 22:08   ` Neil Jerram
2005-10-14  0:37     ` Greg Troxel
2005-10-14  1:28       ` Andreas Rottmann
2005-10-15 11:17         ` Neil Jerram
2005-10-15 15:03           ` Greg Troxel
2005-10-15 17:53             ` Neil Jerram
2005-10-22 23:16           ` Kevin Ryde
2005-10-28 17:45             ` Neil Jerram
2005-10-30 18:04               ` Neil Jerram
2005-10-30 18:15                 ` Tomas Zerolo
2005-10-30 20:37                 ` Thien-Thi Nguyen
2005-10-30 22:59                   ` Neil Jerram
2005-10-31 10:55                     ` Thien-Thi Nguyen
2005-10-31 19:22                       ` Neil Jerram
2005-11-08 12:37                         ` Thien-Thi Nguyen
2005-10-31 13:17                   ` Tomas Zerolo
2005-10-30 23:48                 ` Kevin Ryde
2005-10-31 13:20                   ` Tomas Zerolo
2005-10-31 19:20                   ` Neil Jerram
2005-10-31 23:54                     ` Kevin Ryde
2005-11-12  9:47                       ` Neil Jerram
2005-11-01 23:31                     ` Vorfeed Canal
2005-11-12 17:54                       ` Neil Jerram
2005-11-02  8:44                 ` Ludovic Courtès
2005-12-03 13:05                   ` Neil Jerram
2005-12-13  8:38                     ` Ludovic Courtès
2005-12-16  0:16                       ` Neil Jerram
2005-12-16  1:00                         ` Neil Jerram
2005-12-16  9:55                         ` Ludovic Courtès
2006-01-07 13:37                           ` Neil Jerram
2006-01-11  4:49                             ` steve tell
2006-01-12 18:01                               ` Neil Jerram
2005-10-15 11:24       ` Neil Jerram
2005-10-15 15:01         ` Greg Troxel
2005-10-15 17:49           ` Neil Jerram
2005-10-14  7:24 ` Ludovic Courtès
2005-10-15 11:55   ` Neil Jerram
2005-10-15 15:40     ` Greg Troxel
2005-10-17  8:04       ` Ludovic Courtès
2005-10-17 17:52         ` Greg Troxel
2005-10-18  8:23           ` Search path for C libraries Ludovic Courtès
2005-10-18 10:12             ` Vorfeed Canal [this message]
2005-10-17 17:54         ` Modified load-path proposal Neil Jerram
2005-10-18  7:57           ` Ludovic Courtès
2005-10-19 22:30             ` Neil Jerram
2005-10-20  7:56               ` Vorfeed Canal
2005-10-20  8:05               ` Ludovic Courtès
2005-10-20 22:23                 ` Neil Jerram
2005-10-21  7:59                   ` Ludovic Courtès
2005-10-17 18:10       ` Neil Jerram
2005-10-18 16:16         ` Greg Troxel
2005-10-18 21:24           ` Vorfeed Canal
2005-10-19 22:29           ` Neil Jerram

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=6efab2350510180312r59e14d94he768ba03ac18a97b@mail.gmail.com \
    --to=vorfeed.canal@gmail.com \
    /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).