bug-libtool
[Top][All Lists]
Advanced

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

MAC OS X, static compilation and libtool


From: George Bosilca
Subject: MAC OS X, static compilation and libtool
Date: Mon, 17 Mar 2008 22:35:35 -0400

I run into some troubles with the latest version of libtool (2.2). I didn't notice this problem with older libtool versions, but a coworker confirm it with 1.5.22. To be honest I don't know if it's a libtool problem or a MAC OS X, or whatever.

The problem is when I compile an application with a libtool enabled library (Open MPI for the sake of completeness). This only happen when the library is compiled with the "--enable-static --disable-shared", all other cases seems to perform as expected. By default libtool propose some linking flags that seems sufficient on most Unix environments, except on MAC OS X. For some obscure reasons, MAC OS X always try to link with shared libraries based on the default path (and Open MPI is shipped by Apple with Leopard), instead of following the -L path as specified by the user on the link command.

After digging into the gcc man pages, I found that in order to have the expected behavior (or at least what I think is expected: look into the user provided lib path for all libraries independing if they are static or dynamic) one has to add the -Wl,-search_paths_first flags to the link command. From the gcc documentation, it seems that this is not necessarily MAC OS X specific (but I didn't test it elsewhere).

I was pondering if I should add a special check in our configure for detecting this case or there is a nicer libtool based way of handling this.

  Thanks,
    george.

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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