bug-guile
[Top][All Lists]
Advanced

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

Re: Mac OS X .dylib not working


From: Hans Aberg
Subject: Re: Mac OS X .dylib not working
Date: Tue, 2 Feb 2010 16:48:23 +0100

On 2 Feb 2010, at 15:20, Ken Raeburn wrote:

On Mac OS X (trying it on 10.5.8 PPC G4), guile-1.8.7 cannot open
dynamic library files with name extensions .dylib, but only if they
are renamed using .so instead. On the Bug-Guile list they say it
just calls libltdl, in the libtool package. I have installed latest
of both, but the problem persists:

libtool should produce modules named *.so on Darwin if you pass the
-module flag at link time.  Typically, -avoid-version is used for
modules as well.

But dlopen() on Mac OS X can only open files in the native format, which isn't ELF, and they are typically named with the .dylib file name extension. If it finds a .so file on ELF format, all it does is reporting it cannot be opened.

".so" doesn't mean ELF format, and on some systems including Mac OS X, "dynamically linked shared library" (e.g., a ".dylib" file) is not the same as "dynamically loadable object". Did you not see my earlier email to you and the bug-guile list?

The fact is that currently Guile, which relies on libtool, cannot open .dylib files, though it works perfectly if they are renamed .so. As for what filenames to use, dlopen() does not care - it is something imposed by libtool. Also, all new native DLLs (see below) on Mac OS X are named .dylib.

I have only seen .bundle that are directories, also are called "plugins". 'man dlopen' says:
  dlopen -- load and link a dynamic library or bundle
but does not specify what happens if one tries to open a bundle directory. Looking at an Internet Plug-In, I can do: file '/Library/Internet Plug-Ins/DRM Plugin.bundle/Contents/MacOS/ DRM Plugin' /Library/Internet Plug-Ins/DRM Plugin.bundle/Contents/MacOS/DRM Plugin: header for PowerPC PEF executable

(PEF is the old format used on Mac OS 9 PPC.)

So if one opens this file directly, it has no filename extension at all.

So I suggested on the Bug-Guile list having an opening sequence, say trying: the full name, .dylib, and .so. If you think of .so as a general POSIX standard not tied to ELF, that is of course OK.

  Hans






reply via email to

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