From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 30 17:17:25 2017 Received: (at submit) by debbugs.gnu.org; 30 Jan 2017 22:17:26 +0000 Received: from localhost ([127.0.0.1]:51425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYKGL-0002db-JY for submit@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 ) id 1cYKGK-0002d9-BE for submit@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 ) id 1cYKGD-0008Il-Q3 for submit@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 ) id 1cYKGD-0008Ih-MI for submit@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 ) id 1cYKGA-0004nq-28 for bug-libtool@gnu.org; Mon, 30 Jan 2017 17:17:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cYKG9-0008IE-0S for bug-libtool@gnu.org; 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 ) id 1cYKG8-0008GQ-RF for bug-libtool@gnu.org; Mon, 30 Jan 2017 17:17:12 -0500 Received: by mail-qk0-x234.google.com with SMTP id 11so145187150qkl.3 for ; 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 Date: Mon, 30 Jan 2017 22:17:10 +0000 Message-ID: Subject: Setting DYLD_LIBRARY_PATH doesn't work on recent macOS To: bug-libtool@gnu.org 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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
[Ap= ologies if this is not news; I searched the mailing list archive, but didn&= #39;t find anything about this.]

I have just been trying to debug some libtoolized code on macOS 10.= 12 (Sierra).
I am using l= ldb, to avoid going through some signing rigmarole with gdb.

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's not there. On investigation, DYLD_LIBRARY_PATH is correctly s= et, but is ignored.

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.

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 o= n the Mac I'm borrowing to test a Darwin build of my code!

I guess it won't be long before s= uch 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 use= d in GNU libtool (though I confess I don't know what they are, and righ= t now don't plan to look, as I'm not a regular Darwin user, just so= meone trying to make code compile on this popular platform, sigh).

--
--001a114a8a5c454f0c0547572d71--