GNU bug report logs - #25584
Setting DYLD_LIBRARY_PATH doesn't work on recent macOS

Previous Next

Package: libtool;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Mon, 30 Jan 2017 22:18:01 UTC

Severity: normal

To reply to this bug, email your comments to 25584 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-libtool <at> gnu.org:
bug#25584; Package libtool. (Mon, 30 Jan 2017 22:18:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Reuben Thomas <rrt <at> sc3d.org>:
New bug report received and forwarded. Copy sent to bug-libtool <at> gnu.org. (Mon, 30 Jan 2017 22:18:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: bug-libtool <at> gnu.org
Subject: Setting DYLD_LIBRARY_PATH doesn't work on recent macOS
Date: Mon, 30 Jan 2017 22:17:10 +0000
[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.