bug-libtool
[Top][All Lists]
Advanced

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

Re: MAC OS X, static compilation and libtool


From: George Bosilca
Subject: Re: MAC OS X, static compilation and libtool
Date: Tue, 18 Mar 2008 10:07:09 -0400

Peter, Ralf,

As far as I see libtool internally do the right thing (all our executables and tests compile correctly). The real problem seems to come from the fact that we extract the libtool compilation and linking flags in order to use them inside our wrapper, and that we use -l and - L instead of the absolute path to the libraries.

Peter email confirmed that we should use the full path to our libraries, instead of expecting a specific behavior from the linker. I will replace all (-l and -L) with the full path to our libraries, which definitively looks like the cleanest approach.

  Thanks,
    george.

On Mar 18, 2008, at 2:48 AM, Ralf Wildenhues wrote:

Hello Peter, George,

* Peter O'Gorman wrote on Tue, Mar 18, 2008 at 06:40:59AM CET:
George Bosilca wrote:

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).

If linking libtool libraries, then libtool should add the full path to the static archive (e.g. ../foo/libfoo.a) when calling the linker. This
will overcome even the OS X linker which searches all -L paths for a
dylib before going back to the start again looking for a .a.

So all libs linked with -static should be fine (-static links statically
all uninstalled libtool libraries), as should be all linked with
-static-libtool-libs (which links statically all libtool libraries), no?

That --disable-shared was given will only prevent libtool from creating
shared libraries, not from using them.

Feel free to add -Wl,-search_paths_first to LDFLAGS if $host is darwin*.

I am not sure that this should be handled in libtool, I'd be fine with
adding it by default if another maintainer agrees.

Are you speaking about the -all-static case now?  Or some other case?

Thanks,
Ralf

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


reply via email to

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