[Top][All Lists]

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

Re: Mac OS X .dylib not working

From: Peter O'Gorman
Subject: Re: Mac OS X .dylib not working
Date: Thu, 4 Feb 2010 07:49:17 -0600
User-agent: Mutt/1.5.19 (2009-01-05)

On Thu, Feb 04, 2010 at 01:40:07PM +0100, Hans Aberg wrote:
> On 2 Feb 2010, at 17:52, Bob Friesenhahn wrote:
>> Under OS-X (Leopard and later), the 'dtruss' program can be used to  
>> see what is really going on.
> While at it, I found another problem involving libltdl.7.dylib,  
> guile-1.8.7 and lilypond 2.13.7:
> When upgrading guile using libtool-2.2.6b, lilypond broke, the one which 
> is in an Application distribution:
>   /Applications/LilyPond.app/Contents/Resources/bin/guile
> It has its own
>   /Applications/LilyPond.app/Contents/Resources/lib/libltdl.7.dylib
> However, dtruss shows that segmentation fault is caused when calling
>   /usr/local/lib/libltdl.7.dylib
> When I move this to another name, then lilypond works, but dtruss now  
> shows that it calls
>   /usr/lib/libltdl.7.dylib

Sorry, I missed most of this thread as I was travelling.

What does otool -L
/Applications/LilyPond.app/Contents/Resources/bin/guile say? Which
libltdl.7.dylib does it list?

If you run lilypond with DYLD_PRINT_LIBRARIES=1 set in the environment
does more than one copy of libltdl.7.dylib get loaded?

This sounds like a packaging bug to me though, you can probably fix it
with use of install_name_tool(1).

As for your earlier questions about .so and .dylib - On Mac OS X 10.0
and earlier, there was no way to load MH_DYLIB type files (usually
.dylib extensions) at runtime. API was introduced to allow this in 10.1,
and dlopen() was added in 10.3, rewritten in 10.4 and dlclose() actually
removes the image in 10.5, prior to that only files of MH_BUNDLE type
could be unloaded.

When libtool support for Mac OS X was added, there was no way to load
.dylib files, not much software had any knowledge of Mac OS X, and quite
a lot of things had hardcoded ".so" when loading files at runtime, so to
accomodate this, .so was chosen as the extension when creating loadable
modules (MH_BUNDLE) and .dylib when creating MH_DYLIB. Changing
this now would cause far too many problems.

So, long story short, ltld looks for ".so" because that is the extension
used for loadable modules. Guile wants to use its loadable modules as
input to ld, this is not portable to ancient Mac OS X, nor ancient Net
BSD, and possibly other systems, however it seems unlikly to be a major

I think that covers most of the thread, but I admit to now reading all
of it.

Peter O'Gorman

reply via email to

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