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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: libtool; Reported by: Reuben Thomas <rrt@HIDDEN>; dated Mon, 30 Jan 2017 22:18:01 UTC; Maintainer for libtool is bug-libtool@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 30 Jan 2017 22:17:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 30 17:17:25 2017
Received: from localhost ([127.0.0.1]:51425 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cYKGL-0002db-JY
	for submit <at> debbugs.gnu.org; Mon, 30 Jan 2017 17:17:25 -0500
Received: from eggs.gnu.org ([208.118.235.92]:54855)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rrt@HIDDEN>) id 1cYKGK-0002d9-BE
 for submit <at> debbugs.gnu.org; Mon, 30 Jan 2017 17:17:24 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rrt@HIDDEN>) id 1cYKGD-0008Il-Q3
 for submit <at> debbugs.gnu.org; Mon, 30 Jan 2017 17:17:19 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,HTML_MESSAGE,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:50263)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <rrt@HIDDEN>) id 1cYKGD-0008Ih-MI
 for submit <at> debbugs.gnu.org; Mon, 30 Jan 2017 17:17:17 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45819)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <rrt@HIDDEN>) id 1cYKGA-0004nq-28
 for bug-libtool@HIDDEN; Mon, 30 Jan 2017 17:17:17 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rrt@HIDDEN>) id 1cYKG9-0008IE-0S
 for bug-libtool@HIDDEN; Mon, 30 Jan 2017 17:17:14 -0500
Received: from mail-qk0-x234.google.com ([2607:f8b0:400d:c09::234]:36722)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <rrt@HIDDEN>) id 1cYKG8-0008GQ-RF
 for bug-libtool@HIDDEN; Mon, 30 Jan 2017 17:17:12 -0500
Received: by mail-qk0-x234.google.com with SMTP id 11so145187150qkl.3
 for <bug-libtool@HIDDEN>; Mon, 30 Jan 2017 14:17:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google;
 h=mime-version:from:date:message-id:subject:to;
 bh=siPagCY+uuJDLyMPmLIku9n7S0B4rDMz0gszX+eX+7A=;
 b=bHJrWPXTPNUAX4IFO7JrMt8ceyppawROtTSgXa7uw5Ny2fPW1n80tsNIcVtxwaSv0i
 yHSmAluwhBd7bUerFRx2+G4NTdyi/iSP4744y7Dr5DUGncv1d8BQkrHY/jyMx4X7sIp0
 6z8CDymogWgP/U7Wg/fm8SOlD9jzI73wRKPik=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=siPagCY+uuJDLyMPmLIku9n7S0B4rDMz0gszX+eX+7A=;
 b=PxNDve5blqY4YrT0CwUokTFuEV4ADVMe38ZoPfJ55sFnmjM9mVEvNflGhovUwKSZ40
 d4Bt6YlWO5F3wgEPvYqL2Cfr74DKG+83DNgoJRGeeNX34j+YOoCbBzlrEE1crUYaCNUG
 9OZZrznSiXRnCSLo7Tdl2eb6QIFnlMWLxK6IWrNIog/NgIYdB5Ka2aTfREZZlJwVOC2k
 AfwRLQm6354n2PnjzFltPA7UFvEuiSjKNx1LauaIamIkB45Yk9W2eNSOTRjyqE327BMs
 9YdEyR7XuOdCzE/0P15NnBrdGjANpHXWn5/P2vPKnGh5lelZJaDeOrAz24qbxsQLsD8m
 f/Ag==
X-Gm-Message-State: AIkVDXIBQa8/yCPJ5xvbEiiBtfXnlYsPVksVOYvoBAZksYxKBKZNTQILHgipD4bZ76c7Tcv37wW646pYLAqxY/2n
X-Received: by 10.55.75.143 with SMTP id y137mr23033845qka.39.1485814630790;
 Mon, 30 Jan 2017 14:17:10 -0800 (PST)
MIME-Version: 1.0
Received: by 10.140.88.9 with HTTP; Mon, 30 Jan 2017 14:17:10 -0800 (PST)
From: Reuben Thomas <rrt@HIDDEN>
Date: Mon, 30 Jan 2017 22:17:10 +0000
Message-ID: <CAOnWdogfC1WeS91MXFcm5ehVd6n-ANRkvwtuCDo55R9u7MxFKQ@HIDDEN>
Subject: Setting DYLD_LIBRARY_PATH doesn't work on recent macOS
To: bug-libtool@HIDDEN
Content-Type: multipart/alternative; boundary=001a114a8a5c454f0c0547572d71
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.1 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.1 (----)

--001a114a8a5c454f0c0547572d71
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

[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=E2=80=A6

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

--=20
http://rrt.sc3d.org

--001a114a8a5c454f0c0547572d71
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-size:small">[Ap=
ologies if this is not news; I searched the mailing list archive, but didn&=
#39;t find anything about this.]</div><div class=3D"gmail_default" style=3D=
"font-size:small"><br></div><div class=3D"gmail_default" style=3D"font-size=
:small">I have just been trying to debug some libtoolized code on macOS 10.=
12 (Sierra).</div><div class=3D"gmail_default" style=3D"font-size:small"><b=
r></div><div class=3D"gmail_default" style=3D"font-size:small">I am using l=
ldb, to avoid going through some signing rigmarole with gdb.</div><div clas=
s=3D"gmail_default" style=3D"font-size:small"><br></div><div class=3D"gmail=
_default" style=3D"font-size:small">When I start it up it complains about n=
ot being able to find a dynamic library in /usr/local/lib, which is correct=
, as it&#39;s not there. On investigation, DYLD_LIBRARY_PATH is correctly s=
et, but is ignored.</div><div class=3D"gmail_default" style=3D"font-size:sm=
all"><br></div><div class=3D"gmail_default" style=3D"font-size:small">As fa=
r as I can tell, this is by design: the System Integrity Protection feature=
 of macOS 10.11 and later disables DYLD_LIBRARY_PATH.</div><div class=3D"gm=
ail_default" style=3D"font-size:small"><br></div><div class=3D"gmail_defaul=
t" style=3D"font-size:small">This means that dynamic libraries can&#39;t be=
 loaded in-place using current libtool (I am using 2.4.6).</div><div class=
=3D"gmail_default" style=3D"font-size:small"><br></div><div class=3D"gmail_=
default" style=3D"font-size:small">At the moment, my workaround will be to =
install the library in /usr/local/lib, as I don&#39;t want to disable SIP o=
n the Mac I&#39;m borrowing to test a Darwin build of my code!</div><div cl=
ass=3D"gmail_default" style=3D"font-size:small"><br></div><div class=3D"gma=
il_default" style=3D"font-size:small">I guess it won&#39;t be long before s=
uch security mechanisms surface in popular GNU/Linux distros=E2=80=A6</div>=
<div><br></div><div><div class=3D"gmail_default" style=3D"font-size:small">=
I presume that the measures that XCode uses to get around this could be use=
d in GNU libtool (though I confess I don&#39;t know what they are, and righ=
t now don&#39;t plan to look, as I&#39;m not a regular Darwin user, just so=
meone trying to make code compile on this popular platform, sigh).</div></d=
iv><div><br></div>-- <br><div class=3D"gmail_signature" data-smartmail=3D"g=
mail_signature"><a href=3D"http://rrt.sc3d.org" target=3D"_blank">http://rr=
t.sc3d.org</a></div>
</div>

--001a114a8a5c454f0c0547572d71--




Acknowledgement sent to Reuben Thomas <rrt@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-libtool@HIDDEN. Full text available.
Report forwarded to bug-libtool@HIDDEN:
bug#25584; Package libtool. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.