1 Return-Path: <david@tethera.net>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 5753641ED95
\r
6 for <notmuch@notmuchmail.org>; Fri, 27 Feb 2015 00:31:39 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=2.438 tagged_above=-999 required=5
\r
12 tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id SQ8IeDTzZUNm for <notmuch@notmuchmail.org>;
\r
16 Fri, 27 Feb 2015 00:31:36 -0800 (PST)
\r
17 Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net
\r
19 (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id DBDED431FCB
\r
22 for <notmuch@notmuchmail.org>; Fri, 27 Feb 2015 00:31:35 -0800 (PST)
\r
23 Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim
\r
24 4.80) (envelope-from <david@tethera.net>)
\r
25 id 1YRGDv-0007ug-4X; Fri, 27 Feb 2015 08:24:39 +0000
\r
26 Received: (nullmailer pid 6410 invoked by uid 1000); Fri, 27 Feb 2015
\r
28 From: David Bremner <david@tethera.net>
\r
29 To: "J. Lewis Muir" <jlmuir@imca-cat.org>, notmuch@notmuchmail.org
\r
30 Subject: Re: [PATCH] lib: make notmuch shared library install_name be full
\r
32 In-Reply-To: <1409541227-38895-1-git-send-email-jlmuir@imca-cat.org>
\r
33 References: <1409541227-38895-1-git-send-email-jlmuir@imca-cat.org>
\r
34 User-Agent: Notmuch/0.19+48~gb74ed1c (http://notmuchmail.org) Emacs/24.4.1
\r
35 (x86_64-pc-linux-gnu)
\r
36 Date: Fri, 27 Feb 2015 09:24:25 +0100
\r
37 Message-ID: <87385rkbie.fsf@maritornes.cs.unb.ca>
\r
39 Content-Type: text/plain
\r
40 X-BeenThere: notmuch@notmuchmail.org
\r
41 X-Mailman-Version: 2.1.13
\r
43 List-Id: "Use and development of the notmuch mail system."
\r
44 <notmuch.notmuchmail.org>
\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
48 List-Post: <mailto:notmuch@notmuchmail.org>
\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
52 X-List-Received-Date: Fri, 27 Feb 2015 08:31:39 -0000
\r
54 "J. Lewis Muir" <jlmuir@imca-cat.org> writes:
\r
56 I think Tomi and I agree the content of the patch is OK, or at least as
\r
57 far as we can verify. If you don't mind, could you rework the commit
\r
62 > The install_name of libnotmuch.dylib on Mac OS X is what is written
\r
63 > into a program that links against it. If it is just the name of the
\r
64 > shared library file, as opposed to the full path, the program won't be
\r
65 > able to find it when it runs and will abort. Instead, the install_name
\r
66 > should be the full path to the shared library (in its final installed
\r
70 Drop this part; it makes the commit message overwhelming, especially
\r
71 since most of us don't have (easy) access to a Mac.
\r
74 > An example on Mac OS X Mavericks (10.9.4) follows.
\r
76 > We configure, build, and install notmuch, assuming the user has write
\r
80 > $ CFLAGS='-I/pkg/include' LDFLAGS='-L/pkg/lib' ./configure \
\r
81 > --prefix=/opt/notmuch-current --without-emacs
\r
86 > We inspect the installed notmuch library using the otool system program:
\r
89 > $ otool -L /opt/notmuch-current/lib/libnotmuch.dylib
\r
90 > /opt/notmuch-current/lib/libnotmuch.dylib:
\r
91 > libnotmuch.3.dylib \
\r
92 > (compatibility version 3.1.0, current version 3.1.0)
\r
93 > /pkg/lib/libgmime-2.4.2.dylib \
\r
94 > (compatibility version 7.0.0, current version 7.33.0)
\r
95 > /pkg/lib/libgobject-2.0.0.dylib \
\r
96 > (compatibility version 3801.0.0, current version 3801.2.0)
\r
97 > /pkg/lib/libglib-2.0.0.dylib \
\r
98 > (compatibility version 3801.0.0, current version 3801.2.0)
\r
99 > /pkg/lib/libintl.8.dylib \
\r
100 > (compatibility version 10.0.0, current version 10.2.0)
\r
101 > /pkg/lib/libtalloc.2.1.1.dylib \
\r
102 > (compatibility version 0.0.0, current version 0.0.0)
\r
103 > /pkg/lib/libz.1.dylib \
\r
104 > (compatibility version 2.0.0, current version 2.2.0)
\r
105 > /pkg/lib/libxapian.22.dylib \
\r
106 > (compatibility version 29.0.0, current version 29.4.0)
\r
107 > /usr/lib/libc++.1.dylib \
\r
108 > (compatibility version 1.0.0, current version 120.0.0)
\r
109 > /usr/lib/libSystem.B.dylib \
\r
110 > (compatibility version 1.0.0, current version 1197.1.1)
\r
113 > That's not good. The second line shows the install_name, and it's not a
\r
114 > full path, so any program that links against it as a dependent library
\r
115 > will not be able to find it.
\r
117 > We try running the notmuch program (which is linked against the notmuch
\r
118 > library), and, sure enough, it aborts:
\r
121 > $ /opt/notmuch-current/bin/notmuch --version
\r
122 > dyld: Library not loaded: libnotmuch.3.dylib
\r
123 > Referenced from: /opt/notmuch-current/bin/notmuch
\r
124 > Reason: image not found
\r
125 > Trace/BPT trap: 5
\r
128 > After applying this commit to fix the problem and configuring, building,
\r
129 > and installing again as above, the notmuch library's install_name is now
\r
130 > the correct full path:
\r
133 > $ otool -L /opt/notmuch-current/lib/libnotmuch.dylib
\r
134 > /opt/notmuch-current/lib/libnotmuch.dylib:
\r
135 > /opt/notmuch-current/lib/libnotmuch.3.dylib \
\r
136 > (compatibility version 3.1.0, current version 3.1.0)
\r
137 > /pkg/lib/libgmime-2.4.2.dylib \
\r
138 > (compatibility version 7.0.0, current version 7.33.0)
\r
139 > /pkg/lib/libgobject-2.0.0.dylib \
\r
140 > (compatibility version 3801.0.0, current version 3801.2.0)
\r
141 > /pkg/lib/libglib-2.0.0.dylib \
\r
142 > (compatibility version 3801.0.0, current version 3801.2.0)
\r
143 > /pkg/lib/libintl.8.dylib \
\r
144 > (compatibility version 10.0.0, current version 10.2.0)
\r
145 > /pkg/lib/libtalloc.2.1.1.dylib \
\r
146 > (compatibility version 0.0.0, current version 0.0.0)
\r
147 > /pkg/lib/libz.1.dylib \
\r
148 > (compatibility version 2.0.0, current version 2.2.0)
\r
149 > /pkg/lib/libxapian.22.dylib \
\r
150 > (compatibility version 29.0.0, current version 29.4.0)
\r
151 > /usr/lib/libc++.1.dylib \
\r
152 > (compatibility version 1.0.0, current version 120.0.0)
\r
153 > /usr/lib/libSystem.B.dylib \
\r
154 > (compatibility version 1.0.0, current version 1197.1.1)
\r
157 > And the notmuch program is able to find the notmuch library when run:
\r
160 > $ /opt/notmuch-current/bin/notmuch --version
\r
161 > notmuch 0.18.1+84~g658a00e
\r
165 Add a brief explanation of why Homebrew and Macports already work
\r
166 (a few lines summarizing the info from your followup message).
\r
173 > * http://www.finkproject.org/doc/porting/porting.en.html#\
\r
176 > * https://developer.apple.com/library/mac/documentation/DeveloperTools/\
\r
177 > Conceptual/DynamicLibraries/100-Articles/OverviewOfDynamicLibraries.html
\r
179 > lib/Makefile.local | 2 +-
\r
180 > 1 file changed, 1 insertion(+), 1 deletion(-)
\r
182 > diff --git a/lib/Makefile.local b/lib/Makefile.local
\r
183 > index c56cba9..c83f387 100644
\r
184 > --- a/lib/Makefile.local
\r
185 > +++ b/lib/Makefile.local
\r
186 > @@ -27,7 +27,7 @@ LIBRARY_SUFFIX = dylib
\r
187 > LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
\r
188 > SONAME = libnotmuch.$(LIBNOTMUCH_VERSION_MAJOR).$(LIBRARY_SUFFIX)
\r
189 > LIBNAME = libnotmuch.$(LIBNOTMUCH_VERSION_MAJOR).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE).$(LIBRARY_SUFFIX)
\r
190 > -LIBRARY_LINK_FLAG = -dynamiclib -install_name $(SONAME) -compatibility_version $(LIBNOTMUCH_VERSION_MAJOR).$(LIBNOTMUCH_VERSION_MINOR) -current_version $(LIBNOTMUCH_VERSION_MAJOR).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
\r
191 > +LIBRARY_LINK_FLAG = -dynamiclib -install_name $(libdir)/$(SONAME) -compatibility_version $(LIBNOTMUCH_VERSION_MAJOR).$(LIBNOTMUCH_VERSION_MINOR) -current_version $(LIBNOTMUCH_VERSION_MAJOR).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
\r
193 > LIBRARY_SUFFIX = so
\r
194 > LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
\r
196 > 1.8.5.2 (Apple Git-48)
\r
198 > _______________________________________________
\r
199 > notmuch mailing list
\r
200 > notmuch@notmuchmail.org
\r
201 > http://notmuchmail.org/mailman/listinfo/notmuch
\r