1 Return-Path: <wiz@danbala.ifoer.tuwien.ac.at>
\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 7E686431FBC
\r
6 for <notmuch@notmuchmail.org>; Fri, 3 Jan 2014 13:53:51 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 iwjkVjClywfP for <notmuch@notmuchmail.org>;
\r
16 Fri, 3 Jan 2014 13:53:42 -0800 (PST)
\r
17 X-Greylist: delayed 361 seconds by postgrey-1.32 at olra;
\r
18 Fri, 03 Jan 2014 13:53:42 PST
\r
19 Received: from danbala.ifoer.tuwien.ac.at (danbala.ifoer.tuwien.ac.at
\r
21 by olra.theworths.org (Postfix) with ESMTP id 898E8431FB6
\r
22 for <notmuch@notmuchmail.org>; Fri, 3 Jan 2014 13:53:42 -0800 (PST)
\r
23 Received: by danbala.ifoer.tuwien.ac.at (Postfix, from userid 116)
\r
24 id 0665B390DAF; Fri, 3 Jan 2014 22:47:35 +0100 (CET)
\r
25 Date: Fri, 3 Jan 2014 22:47:35 +0100
\r
26 From: Thomas Klausner <tk@giga.or.at>
\r
27 To: notmuch@notmuchmail.org
\r
28 Subject: notmuch-0.16: realpath() compatibility issue; clang visibility
\r
30 Message-ID: <20140103214735.GG27614@danbala.tuwien.ac.at>
\r
32 Content-Type: multipart/mixed; boundary="cNdxnHkX5QqsyA0e"
\r
33 Content-Disposition: inline
\r
34 X-Mailman-Approved-At: Sat, 04 Jan 2014 04:25:46 -0800
\r
35 X-BeenThere: notmuch@notmuchmail.org
\r
36 X-Mailman-Version: 2.1.13
\r
38 List-Id: "Use and development of the notmuch mail system."
\r
39 <notmuch.notmuchmail.org>
\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
41 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
43 List-Post: <mailto:notmuch@notmuchmail.org>
\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
47 X-List-Received-Date: Fri, 03 Jan 2014 21:53:51 -0000
\r
51 Content-Type: text/plain; charset=us-ascii
\r
52 Content-Disposition: inline
\r
56 I'm currently starting to try out notmuch-0.16 on NetBSD. It went off
\r
57 to a rocky start, since it segfaulted in the initial config setup.
\r
59 Debugging it I found that notmuch uses a glibc extension to realpath,
\r
60 allowing NULL as second argument.
\r
62 I've converted it to use a prepared buffer instead; attached is a
\r
63 possible patch that makes notmuch complete its setup phase for me, and
\r
64 adds inclusion of the header files suggested by the realpath man page
\r
65 on NetBSD. Please address this issue in some way in the next release.
\r
67 Additionally, when compiling with clang, there are issues with the
\r
68 visibility. The symptoms are:
\r
70 In file included from lib/database.cc:21:
\r
71 In file included from ./lib/database-private.h:33:
\r
72 ./lib/notmuch-private.h:479:8: error: visibility does not match previous declaration
\r
73 array subscriptstruct visible _notmuch_string_list {
\r
75 ./lib/notmuch-private.h:67:33: note: expanded from macro 'visible'
\r
76 # define visible __attribute__((visibility("default")))
\r
78 ./lib/notmuch-private.h:52:13: note: previous attribute is here
\r
79 #pragma GCC visibility push(hidden)
\r
82 In file included from lib/parse-time-vrp.cc:23:
\r
83 In file included from ./lib/database-private.h:33:
\r
84 ./lib/notmuch-private.h:479:8: error: visibility does not match previous declaration
\r
85 struct visible _notmuch_string_list {
\r
87 ./lib/notmuch-private.h:67:33: note: expanded from macro 'visible'
\r
88 # define visible __attribute__((visibility("default")))
\r
90 ./lib/notmuch-private.h:52:13: note: previous attribute is here
\r
91 #pragma GCC visibility push(hidden)
\r
93 1 warning generated.
\r
94 In file included from lib/directory.cc:21:
\r
95 ./lib/notmuch-private.h:479:8: error: visibility does not match previous declaration
\r
96 struct visible _notmuch_string_list {
\r
98 ./lib/notmuch-private.h:67:33: note: expanded from macro 'visible'
\r
99 # define visible __attribute__((visibility("default")))
\r
101 ./lib/notmuch-private.h:52:13: note: previous attribute is here
\r
102 #pragma GCC visibility push(hidden)
\r
105 and so on. I guess it is because the visibility differs between c and
\r
106 c++. I've disabled visibility locally, see second attached patch, but
\r
107 of course that's not a solution, just a workaround. Suggestions
\r
114 Content-Type: text/plain; charset=us-ascii
\r
115 Content-Disposition: attachment; filename="patch-notmuch-config.c"
\r
119 NULL as second argument for realpath() is only supported in glibc.
\r
120 Use more portable code.
\r
122 --- notmuch-config.c.orig 2013-08-03 11:29:40.000000000 +0000
\r
123 +++ notmuch-config.c
\r
127 #include <assert.h>
\r
128 +#include <sys/param.h>
\r
129 +#include <stdlib.h>
\r
131 static const char toplevel_config_comment[] =
\r
132 " .notmuch-config - Configuration file for the notmuch mail system\n"
\r
133 @@ -444,7 +446,7 @@ int
\r
134 notmuch_config_save (notmuch_config_t *config)
\r
137 - char *data, *filename;
\r
138 + char *data, filename[MAXPATHLEN];
\r
139 GError *error = NULL;
\r
141 data = g_key_file_to_data (config->key_file, &length, NULL);
\r
142 @@ -454,15 +456,9 @@ notmuch_config_save (notmuch_config_t *c
\r
145 /* Try not to overwrite symlinks. */
\r
146 - filename = realpath (config->filename, NULL);
\r
147 - if (! filename) {
\r
148 + if (! realpath (config->filename, filename)) {
\r
149 if (errno == ENOENT) {
\r
150 - filename = strdup (config->filename);
\r
151 - if (! filename) {
\r
152 - fprintf (stderr, "Out of memory.\n");
\r
156 + strcpy(filename, config->filename);
\r
158 fprintf (stderr, "Error canonicalizing %s: %s\n", config->filename,
\r
160 @@ -480,12 +476,10 @@ notmuch_config_save (notmuch_config_t *c
\r
161 filename, error->message);
\r
163 g_error_free (error);
\r
175 Content-Type: text/plain; charset=us-ascii
\r
176 Content-Disposition: attachment; filename="patch-lib_notmuch-private.h"
\r
180 Doesn't compile with clang.
\r
182 --- lib/notmuch-private.h.orig 2013-08-03 11:29:40.000000000 +0000
\r
183 +++ lib/notmuch-private.h
\r
184 @@ -64,7 +64,7 @@ NOTMUCH_BEGIN_DECLS
\r
185 #define unused(x) x __attribute__ ((unused))
\r
188 -# define visible __attribute__((visibility("default")))
\r
194 --cNdxnHkX5QqsyA0e--
\r