unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel@gnu.org
Subject: Re: Guile test-ffi uses an unportable assumption
Date: Sun, 24 Jul 2016 17:13:20 +0300	[thread overview]
Message-ID: <83y44rt98f.fsf@gnu.org> (raw)
In-Reply-To: <87zip8qcjd.fsf@pobox.com> (message from Andy Wingo on Sat, 23 Jul 2016 23:17:58 +0200)

> From: Andy Wingo <wingo@pobox.com>
> Cc: guile-devel@gnu.org
> Date: Sat, 23 Jul 2016 23:17:58 +0200
> 
> > It assumes that libltdl can only produce a handle for a symbol in the
> > the program itself, as opposed to those loaded from shared libraries.
> > It tries 'strerror'.  This cannot work on MS-Windows, unless the
> > program was linked with -export-dynamic, which is not true for
> > the test program.
> 
> Interesting.  The test program is a Scheme script which looks up
> strerror in the dlopen(NULL).  Libguile is compiled with -export-dynamic
> but the guile binary is not.  Which part needs to be compiled with
> -export-dynamic, do you think?

The guile binary.  Here's what the libltdl documentation has to say
about this:

 -- Function: lt_dlhandle lt_dlopen (const char *FILENAME)
    [...]
     If FILENAME is `NULL' and the program was linked with
     `-export-dynamic' or `-dlopen self', `lt_dlopen' will return a
     handle for the program itself, which can be used to access its
     symbols.
    [...]
     If you use `lt_dlopen (NULL)' to get a HANDLE for the running
     binary, that handle will always be marked as resident, and
     consequently cannot be successfully `lt_dlclose'd.

However, in the case in point even compiling guile with -export-dynamic
won't help, because the function being used by the test, strerror,
comes from the C library, and is not statically linked into the guile
binary.  So I suggest to modify the test to use a function that is
part of the guile binary's own sources.



  reply	other threads:[~2016-07-24 14:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-23 11:51 Guile test-ffi uses an unportable assumption Eli Zaretskii
2016-07-23 21:17 ` Andy Wingo
2016-07-24 14:13   ` Eli Zaretskii [this message]
2016-08-10  8:31     ` Mark H Weaver
2016-08-13  7:33       ` Eli Zaretskii

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=83y44rt98f.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.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).