unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Hans Aberg <haberg-1@telia.com>
Cc: guile-devel@gnu.org, Michael Ellis <michael.f.ellis@gmail.com>
Subject: Re: FFI on OS X?
Date: Thu, 03 Mar 2011 11:40:55 +0100	[thread overview]
Message-ID: <87hbbkwkp4.fsf@gnu.org> (raw)
In-Reply-To: <31E3EB3C-7715-4139-8960-9EECAA3D2470@telia.com> (Hans Aberg's message of "Thu, 3 Mar 2011 10:15:06 +0100")

Hi Hans,

Hans Aberg <haberg-1@telia.com> writes:

> On 3 Mar 2011, at 00:03, Ludovic Courtès wrote:
>
>>>>> scheme@(guile-user)> (define libm (dynamic-link
>>>>> "/usr/lib/libm.dylib")) ERROR: In procedure dynamic-link: file:
>>>>> "/usr/lib/libm.dylib", message: "file not found"
>>>>  You should omit the extension, which will be automatically
>>>> inferred by Guile (actually ltdl) depending on the system:
>>>> 
>>>> (dynamic-link "/usr/lib/libm")
>>>> 
>>>> or:
>>>> 
>>>> (dynamic-link "libm")
>>>  None of those work - I checked and rechecked that. Making a soft
>>> link ending on ".so", and it works fine. I have seen this before in
>>> the Bessel function example.
>>  Right.  There’s this insightful test started by you last year:
>> 
>>  http://lists.gnu.org/archive/html/bug-libtool/2010-02/msg00000.html
>> 
>> The crux is that on older MacOS X versions ‘.dylib’ are shared
>> libraries (not dlopenable), whereas ‘.so’ are “bundles”
>> (dlopenable).  That’s why lt_dlopenext (which is what ‘dynamic-link’
>> uses) doesn’t try to open ‘.dylib’ files.
>
> The shared libraries (not dynamically loadable, except as when
> starting up the program like some web browser plugins) were on the PPC
> platform (XCOFF and PEF I think it was).
>
> Now (Mac OS 10.5 and later), all is loadable. Haven't seen any .so
> files, except as coming from GNU/Linux.

I would recommend discussing this with the Libtool folks, to see how
ltdl could adapt to the new situation.  But keep in mind that ltdl
should still do the right thing on those older versions of OS X
described above.

Perhaps lt_dlopenext could look for .dylib files if and only if it’s on
one of these newer OS X versions.  If you can tell Libtool people how
exactly ltdl can determine whether .dylib can be dlopened or not, then
you’re all set.

> UNIX, and the only parts in the UNIX standard recognizing file name

“UNIX standard”, what a funny phrase!  :-)

Thanks,
Ludo’.



  reply	other threads:[~2011-03-03 10:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTin1oDrzx9-KxvU7DGwwLxZrRbRHs8+9ygBCwD23@mail.gmail.com>
2011-03-02 20:44 ` FFI on OS X? Ludovic Courtès
2011-03-02 21:15   ` Hans Aberg
2011-03-02 23:03     ` Ludovic Courtès
2011-03-03  9:15       ` Hans Aberg
2011-03-03 10:40         ` Ludovic Courtès [this message]
2011-03-03 11:34           ` Hans Aberg
2011-03-03 13:11             ` Ludovic Courtès
2011-03-03 14:06               ` Hans Aberg
2011-03-02 23:14     ` Andreas Rottmann
2011-03-03  9:51       ` Hans Aberg
2011-03-03 10:52       ` Ludovic Courtès
2011-03-03 13:20         ` Andreas Rottmann
2011-03-03 17:50           ` Ludovic Courtès
2011-03-09 22:04             ` Andy Wingo

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=87hbbkwkp4.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=haberg-1@telia.com \
    --cc=michael.f.ellis@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).