Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / f8 / 15cbda8bda1f3782cdeeb275f773c6c4172e11
1 Return-Path: <jinwoo68@gmail.com>\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 arlo.cworth.org (Postfix) with ESMTP id 2D0576DE0948\r
6  for <notmuch@notmuchmail.org>; Sat, 13 Jun 2015 23:20:32 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.57\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.57 tagged_above=-999 required=5 tests=[AWL=-0.000,\r
12   DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13  FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7,\r
14  RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001]\r
15  autolearn=disabled\r
16 Received: from arlo.cworth.org ([127.0.0.1])\r
17  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
18  with ESMTP id 00d3jE0eCqdQ for <notmuch@notmuchmail.org>;\r
19  Sat, 13 Jun 2015 23:20:29 -0700 (PDT)\r
20 Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com\r
21  [209.85.220.50])\r
22  by arlo.cworth.org (Postfix) with ESMTPS id 63CC56DE0350\r
23  for <notmuch@notmuchmail.org>; Sat, 13 Jun 2015 23:20:29 -0700 (PDT)\r
24 Received: by pacgb13 with SMTP id gb13so15433456pac.1\r
25  for <notmuch@notmuchmail.org>; Sat, 13 Jun 2015 23:20:28 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27  h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
28  :mime-version:content-type;\r
29  bh=+zcSkxkX8+5Yd9amvhK4VyVTROGjVtZ/xpXSk/oDGm0=;\r
30  b=t+2Jp9Sn6J1ITC+mG1Z5uGSEC523b7pWBnkzrBO/eDY6fQEO47jYcplvuQW8nC56Tk\r
31  527xdvY8+wBdF82UaT8CfJ/lVNSdzFmFCO1aZ82MWti2HVVh2k6jXpcc+peNkB4R9Xx4\r
32  wBN90UGaYWpls9FGBxMXow+p6lK7wyD3+quZ/wKuOIC4JrgXaIfgd2J1wHPVLIJ1T3qK\r
33  Y1pd1KSb2rua+IPQSIP9s1D1+62R/zmjbuurpIu1PZni+/1I7WwNac2IdZEyDJHHNGa/\r
34  MyFG6AA/zbZ5tjfNy1dPyiHCLHVatqmXOXXcTC2XGMjw40veNZe41Hit6DIuSrNMqg+c\r
35  ujaQ==\r
36 X-Received: by 10.66.66.140 with SMTP id f12mr38067295pat.120.1434262828457;\r
37  Sat, 13 Jun 2015 23:20:28 -0700 (PDT)\r
38 Received: from localhost ([2601:647:4b02:71ea:edc7:1c56:e47a:dbb0])\r
39  by mx.google.com with ESMTPSA id nt6sm4133442pbc.18.2015.06.13.23.20.25\r
40  (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
41  Sat, 13 Jun 2015 23:20:26 -0700 (PDT)\r
42 From: Jinwoo Lee <jinwoo68@gmail.com>\r
43 To: David Bremner <david@tethera.net>, David Bremner <david@tethera.net>,\r
44  notmuch@notmuchmail.org\r
45 Subject: Re: [PATCH] lib, ruby: make use of -Wl,--no-undefined configurable\r
46 In-Reply-To: <1434261524-14139-1-git-send-email-david@tethera.net>\r
47 References: <1433142542-2307-3-git-send-email-david@tethera.net>\r
48  <1434261524-14139-1-git-send-email-david@tethera.net>\r
49 User-Agent: Notmuch/0.20.1+21~g4e79903 (http://notmuchmail.org) Emacs/24.5.1\r
50  (x86_64-apple-darwin14.3.0)\r
51 Date: Sat, 13 Jun 2015 23:20:24 -0700\r
52 Message-ID: <yq65a8w2u7yv.fsf@jinwoo-macbookair.roam.corp.google.com>\r
53 MIME-Version: 1.0\r
54 Content-Type: multipart/mixed; boundary="=-=-="\r
55 X-BeenThere: notmuch@notmuchmail.org\r
56 X-Mailman-Version: 2.1.18\r
57 Precedence: list\r
58 List-Id: "Use and development of the notmuch mail system."\r
59  <notmuch.notmuchmail.org>\r
60 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
61  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
62 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
63 List-Post: <mailto:notmuch@notmuchmail.org>\r
64 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
65 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
66  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
67 X-List-Received-Date: Sun, 14 Jun 2015 06:20:32 -0000\r
68 \r
69 --=-=-=\r
70 Content-Type: text/plain\r
71 \r
72 There are 2 problems.\r
73 \r
74 1. The file, bindings/Makefile.local still has lib/libnotmuch.so as the\r
75    dependency of ruby-bindings.\r
76 \r
77 > make: *** No rule to make target `lib/libnotmuch.so', needed by\r
78 > `ruby-bindings'.  Stop.\r
79 \r
80 2. After manually changing it to lib/libnotmuch.dylib, I still get an\r
81    error like below:\r
82 \r
83 > cd bindings/ruby && \\r
84 >               EXTRA_LDFLAGS="" \\r
85 >               ruby extconf.rb --vendor\r
86 > checking for notmuch_database_create in libnotmuch.so... no\r
87 > *** extconf.rb failed ***\r
88 > Could not create Makefile due to some reason, probably lack of\r
89 > necessary libraries and/or headers.  Check the mkmf.log file for more\r
90 > details.  You may need configuration options.\r
91 \r
92 > Provided configuration options:\r
93 >       --with-opt-dir\r
94 >       --without-opt-dir\r
95 >       --with-opt-include\r
96 >       --without-opt-include=${opt-dir}/include\r
97 >       --with-opt-lib\r
98 >       --without-opt-lib=${opt-dir}/lib\r
99 >       --with-make-prog\r
100 >       --without-make-prog\r
101 >       --srcdir=.\r
102 >       --curdir\r
103 >       --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby\r
104 > make: *** [ruby-bindings] Error 1\r
105 \r
106 I tried updating extconf.rb to change libnotmuch.so to libnotmuch.dylib\r
107 but that still emit a similar error.\r
108 \r
109 And the attached is the log file, mkmf.log generated in bindings/ruby.\r
110 \r
111 \r
112 --=-=-=\r
113 Content-Type: text/plain\r
114 Content-Disposition: attachment; filename=mkmf.log\r
115 Content-Description: mkmf.log\r
116 \r
117 have_local_library: checking for notmuch_database_create in libnotmuch.dylib... -------------------- no\r
118 \r
119 "xcrun clang -o conftest -I../../lib -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT    -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c  -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L. -L/usr/local/lib    -arch x86_64 -arch i386   -lruby.2.0.0  -lpthread -ldl -lobjc "\r
120 ld: warning: directory not found for option '-L/usr/local/lib'\r
121 ld: warning: directory not found for option '-L/usr/local/lib'\r
122 checked program was:\r
123 /* begin */\r
124 1: #include "ruby.h"\r
125 2: \r
126 3: int main(int argc, char **argv)\r
127 4: {\r
128 5:   return 0;\r
129 6: }\r
130 /* end */\r
131 \r
132 "xcrun clang -o conftest -I../../lib -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT    -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c  -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L. -L/usr/local/lib    -arch x86_64 -arch i386   -lruby.2.0.0 ../../lib/libnotmuch.dylib -lpthread -ldl -lobjc "\r
133 ld: warning: directory not found for option '-L/usr/local/lib'\r
134 ld: warning: directory not found for option '-L/usr/local/lib'\r
135 ld: warning: ignoring file ../../lib/libnotmuch.dylib, file was built for x86_64 which is not the architecture being linked (i386): ../../lib/libnotmuch.dylib\r
136 Undefined symbols for architecture i386:\r
137   "_notmuch_database_create", referenced from:\r
138       _t in conftest-2cad94.o\r
139 ld: symbol(s) not found for architecture i386\r
140 clang: error: linker command failed with exit code 1 (use -v to see invocation)\r
141 checked program was:\r
142 /* begin */\r
143  1: #include "ruby.h"\r
144  2: \r
145  3: #include <notmuch.h>\r
146  4: \r
147  5: /*top*/\r
148  6: extern int t(void);\r
149  7: int t(void) { void ((*volatile p)()); p = (void ((*)()))notmuch_database_create; return 0; }\r
150  8: int main(int argc, char **argv)\r
151  9: {\r
152 10:   if (argc > 1000000) {\r
153 11:     printf("%p", &t);\r
154 12:   }\r
155 13: \r
156 14:   return 0;\r
157 15: }\r
158 /* end */\r
159 \r
160 "xcrun clang -o conftest -I../../lib -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT    -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c  -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L. -L/usr/local/lib    -arch x86_64 -arch i386   -lruby.2.0.0 ../../lib/libnotmuch.dylib -lpthread -ldl -lobjc "\r
161 conftest.c:7:39: error: too few arguments to function call, expected 2, have 0\r
162 int t(void) { notmuch_database_create(); return 0; }\r
163               ~~~~~~~~~~~~~~~~~~~~~~~ ^\r
164 ../../lib/notmuch.h:234:1: note: 'notmuch_database_create' declared here\r
165 notmuch_status_t\r
166 ^\r
167 1 error generated.\r
168 checked program was:\r
169 /* begin */\r
170  1: #include "ruby.h"\r
171  2: \r
172  3: #include <notmuch.h>\r
173  4: \r
174  5: /*top*/\r
175  6: extern int t(void);\r
176  7: int t(void) { notmuch_database_create(); return 0; }\r
177  8: int main(int argc, char **argv)\r
178  9: {\r
179 10:   if (argc > 1000000) {\r
180 11:     printf("%p", &t);\r
181 12:   }\r
182 13: \r
183 14:   return 0;\r
184 15: }\r
185 /* end */\r
186 \r
187 --------------------\r
188 \r
189 \r
190 --=-=-=\r
191 Content-Type: text/plain\r
192 \r
193 \r
194 On Sat, Jun 13, 2015 at 10:58 PM, David Bremner <david@tethera.net> wrote:\r
195 > In particular this is supposed to help build on systems (presumably\r
196 > using a non-gnu ld) where this flag is not available.\r
197 > ---\r
198 >  bindings/Makefile.local  |  4 +++-\r
199 >  bindings/ruby/extconf.rb |  5 +++--\r
200 >  configure                | 13 +++++++++++++\r
201 >  lib/Makefile.local       |  2 +-\r
202 >  4 files changed, 20 insertions(+), 4 deletions(-)\r
203 >\r
204 > diff --git a/bindings/Makefile.local b/bindings/Makefile.local\r
205 > index 16817f5..d236f01 100644\r
206 > --- a/bindings/Makefile.local\r
207 > +++ b/bindings/Makefile.local\r
208 > @@ -5,7 +5,9 @@ dir := bindings\r
209 >  # force the shared library to be built\r
210 >  ruby-bindings: lib/libnotmuch.so\r
211 >  ifeq ($(HAVE_RUBY_DEV),1)\r
212 > -     cd $(dir)/ruby && ruby extconf.rb --vendor\r
213 > +     cd $(dir)/ruby && \\r
214 > +             EXTRA_LDFLAGS="$(NO_UNDEFINED_LDFLAGS)" \\r
215 > +             ruby extconf.rb --vendor\r
216 >       $(MAKE) -C $(dir)/ruby\r
217 >  else\r
218 >       @echo Missing dependency, skipping ruby bindings\r
219 > diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb\r
220 > index 6160db2..6d5607e 100644\r
221 > --- a/bindings/ruby/extconf.rb\r
222 > +++ b/bindings/ruby/extconf.rb\r
223 > @@ -10,8 +10,9 @@ dir = File.join('..', '..', 'lib')\r
224 >  # includes\r
225 >  $INCFLAGS = "-I#{dir} #{$INCFLAGS}"\r
226 >  \r
227 > -# make sure there are no undefined symbols\r
228 > -$LDFLAGS += ' -Wl,--no-undefined'\r
229 > +if ENV['EXTRA_LDFLAGS']\r
230 > +  $LDFLAGS += " " + ENV['EXTRA_LDFLAGS']\r
231 > +end\r
232 >  \r
233 >  def have_local_library(lib, path, func, headers = nil)\r
234 >    checking_for checking_message(func, lib) do\r
235 > diff --git a/configure b/configure\r
236 > index 13a8dca..b967a4e 100755\r
237 > --- a/configure\r
238 > +++ b/configure\r
239 > @@ -751,6 +751,16 @@ else\r
240 >      as_needed_ldflags=""\r
241 >  fi\r
242 >  \r
243 > +printf "Checking for -Wl,--no-undefined... "\r
244 > +if ${CC} -Wl,--no-undefined -o minimal minimal.c >/dev/null 2>&1\r
245 > +then\r
246 > +    printf "Yes.\n"\r
247 > +    no_undefined_ldflags="-Wl,--no-undefined"\r
248 > +else\r
249 > +    printf "No (nothing to worry about).\n"\r
250 > +    no_undefined_ldflags=""\r
251 > +fi\r
252 > +\r
253 >  WARN_CXXFLAGS=""\r
254 >  printf "Checking for available C++ compiler warning flags... "\r
255 >  for flag in -Wall -Wextra -Wwrite-strings; do\r
256 > @@ -955,6 +965,9 @@ RPATH_LDFLAGS = ${rpath_ldflags}\r
257 >  # Flags needed to have linker link only to necessary libraries\r
258 >  AS_NEEDED_LDFLAGS = ${as_needed_ldflags}\r
259 >  \r
260 > +# Flags to have the linker flag undefined symbols in object files\r
261 > +NO_UNDEFINED_LDFLAGS = ${no_undefined_ldflags}\r
262 > +\r
263 >  # Whether valgrind header files are available\r
264 >  HAVE_VALGRIND = ${have_valgrind}\r
265 >  \r
266 > diff --git a/lib/Makefile.local b/lib/Makefile.local\r
267 > index f9ecd50..b58b4e8 100644\r
268 > --- a/lib/Makefile.local\r
269 > +++ b/lib/Makefile.local\r
270 > @@ -33,7 +33,7 @@ LIBRARY_SUFFIX = so\r
271 >  LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)\r
272 >  SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)\r
273 >  LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)\r
274 > -LIBRARY_LINK_FLAG = -shared -Wl,--version-script=notmuch.sym,-soname=$(SONAME) -Wl,--no-undefined\r
275 > +LIBRARY_LINK_FLAG = -shared -Wl,--version-script=notmuch.sym,-soname=$(SONAME) $(NO_UNDEFINED_LDFLAGS)\r
276 >  ifeq ($(PLATFORM),OPENBSD)\r
277 >  LIBRARY_LINK_FLAG += -lc\r
278 >  endif\r
279 > -- \r
280 > 2.1.4\r
281 >\r
282 > _______________________________________________\r
283 > notmuch mailing list\r
284 > notmuch@notmuchmail.org\r
285 > http://notmuchmail.org/mailman/listinfo/notmuch\r
286 \r
287 --=-=-=--\r