On Aug 22, 2007, at 10:24 AM, Jason Stelzer wrote:
I alluded to this before, but does anyone know the moral equivalent to a -rpath linker directive on os x?

there isn't, -rpath is an ELFism.

On Mac OS X, install_name of the library you link to is added to the application (it's what you see when you do otool -L on a binary).

dyld will first look for the library at that location, then will search its default fallback path ($(HOME)/lib:/usr/local/lib:/lib:/ usr/lib).

It would help in this situation a great deal. Elf executables can be linked in a way that includes path information to the libraries used at compile time. The down side to this is that if you go changing paths around where stuff is installed, things break. The up side to it is that you know what library is used at runtime when a binary is executed from a (relatively) sane environment. I'm sure rpath isn't bulletproof, but it does help.

I thought I read somewhere (public) that -rpath support/emulation is being looked at for some future OS release.

Have you tried expressly setting DYLD_FALLBACK_LIBRARY_PATH at compile time? By default, it is set to $(HOME)/lib:/usr/local/ lib:/lib:/usr/lib. Having $HOME/lib first seems goofy to me, but I don't actually have a $HOME/lib. My understanding is that overriding this would effectively cut /usr/local out of the library search path entirely.

you're confusing compile-time and runtime.

Again, I'm just going by the dyld man page. This would at least help the compile/upgrade phase of macports by excluding the stuff in /usr/local thus achieving your goal of only using macports/apple libraries.

/usr/local is searched by gcc (as one of the system paths).
--
Daniel J. Luke
+========================================================+
| *---------------- [EMAIL PROTECTED] ----------------* |
| *-------------- http://www.geeklair.net -------------* |
+========================================================+
|   Opinions expressed are mine and do not necessarily   |
|          reflect the opinions of my employer.          |
+========================================================+


Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________
macports-users mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo/macports-users

Reply via email to