GNU bug report logs -
#25584
Setting DYLD_LIBRARY_PATH doesn't work on recent macOS
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
[Apologies if this is not news; I searched the mailing list archive, but
didn't find anything about this.]
I have just been trying to debug some libtoolized code on macOS 10.12
(Sierra).
I am using lldb, to avoid going through some signing rigmarole with gdb.
When I start it up it complains about not being able to find a dynamic
library in /usr/local/lib, which is correct, as it's not there. On
investigation, DYLD_LIBRARY_PATH is correctly set, but is ignored.
As far as I can tell, this is by design: the System Integrity Protection
feature of macOS 10.11 and later disables DYLD_LIBRARY_PATH.
This means that dynamic libraries can't be loaded in-place using current
libtool (I am using 2.4.6).
At the moment, my workaround will be to install the library in
/usr/local/lib, as I don't want to disable SIP on the Mac I'm borrowing to
test a Darwin build of my code!
I guess it won't be long before such security mechanisms surface in popular
GNU/Linux distros…
I presume that the measures that XCode uses to get around this could be
used in GNU libtool (though I confess I don't know what they are, and right
now don't plan to look, as I'm not a regular Darwin user, just someone
trying to make code compile on this popular platform, sigh).
--
http://rrt.sc3d.org
[Message part 2 (text/html, inline)]
This bug report was last modified 8 years and 202 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.