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 2FBF7431FBF
\r
6 for <notmuch@notmuchmail.org>; Thu, 8 May 2014 15:09:28 -0700 (PDT)
\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 rUeFe8zQpKxx for <notmuch@notmuchmail.org>;
\r
16 Thu, 8 May 2014 15:09:22 -0700 (PDT)
\r
17 Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net
\r
18 [87.98.215.224]) (using TLSv1 with cipher AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 0A787431FAE
\r
21 for <notmuch@notmuchmail.org>; Thu, 8 May 2014 15:09:22 -0700 (PDT)
\r
22 Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim
\r
23 4.72) (envelope-from <david@tethera.net>)
\r
24 id 1WiWU0-0000NE-FW; Thu, 08 May 2014 22:08:04 +0000
\r
25 Received: (nullmailer pid 12014 invoked by uid 1000); Thu, 08 May 2014
\r
27 From: David Bremner <david@tethera.net>
\r
28 To: Charles Celerier <cceleri@cs.stanford.edu>, Notmuch Mail
\r
29 <notmuch@notmuchmail.org>
\r
30 Subject: Re: [PATCH v2 5/5] T360-symbol-hiding: Use nm instead of objdump.
\r
31 In-Reply-To: <m2zjisnwie.fsf@jane.lan>
\r
32 References: <1399395748-44920-1-git-send-email-cceleri@cs.stanford.edu>
\r
33 <1399434615-28425-1-git-send-email-cceleri@cs.stanford.edu>
\r
34 <1399434615-28425-2-git-send-email-cceleri@cs.stanford.edu>
\r
35 <87d2fov2qj.fsf@maritornes.cs.unb.ca> <m2zjisnwie.fsf@jane.lan>
\r
36 User-Agent: Notmuch/0.18 (http://notmuchmail.org) Emacs/24.3.1
\r
37 (x86_64-pc-linux-gnu)
\r
38 Date: Fri, 09 May 2014 07:07:44 +0900
\r
39 Message-ID: <87a9arvs9b.fsf@maritornes.cs.unb.ca>
\r
41 Content-Type: text/plain
\r
42 X-BeenThere: notmuch@notmuchmail.org
\r
43 X-Mailman-Version: 2.1.13
\r
45 List-Id: "Use and development of the notmuch mail system."
\r
46 <notmuch.notmuchmail.org>
\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
50 List-Post: <mailto:notmuch@notmuchmail.org>
\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
54 X-List-Received-Date: Thu, 08 May 2014 22:09:28 -0000
\r
56 Charles Celerier <cceleri@cs.stanford.edu> writes:
\r
58 > David Bremner <david@tethera.net> writes:
\r
60 >> Charles Celerier <cceleri@cs.stanford.edu> writes:
\r
61 >>> test_begin_subtest 'comparing existing to exported symbols'
\r
62 >>> -objdump -t $TEST_DIRECTORY/../lib/*.o | awk '$4 == ".text" && $6 ~ "^notmuch" {print $6}' | sort | uniq > ACTUAL
\r
63 >>> +nm -g $TEST_DIRECTORY/../lib/*.o | sed -n 's/.*\s\+T\s\+_\(notmuch_.*\)/\1/p' | sort | uniq > ACTUAL
\r
64 >>> sed -n 's/[[:blank:]]*\(notmuch_[^;]*\);/\1/p' $TEST_DIRECTORY/../notmuch.sym | sort | uniq > EXPORTED
\r
66 >> Hmm. It seems like the _ there is wrong. It grabs all of the symbols
\r
67 >> starting with _notmuch, which are symbols we _don't_ want exported.
\r
68 >> It makes me wonder what ends up in "notmuch.sym" on MacOS, if that test
\r
71 > Ok. Apologies in advance for the verbose content of this email. Here is my notmuch.sym:
\r
73 Actually, that's perfect. I think I finally understand what's going on,
\r
74 if not completely how to fix it yet.
\r
81 this looks fine; only mangled C++ stuff is different.
\r
83 > The output of the test in question (T360-symbol-hiding) after
\r
84 > applying all of the patches in this series is
\r
86 > T360-symbol-hiding: Testing exception symbol hiding
\r
88 > PASS checking output
\r
89 > FAIL comparing existing to exported symbols
\r
90 > --- T360-symbol-hiding.3.EXPORTED 2014-05-08
\r
91 > 14:48:52.000000000 +0000
\r
92 > +++ T360-symbol-hiding.3.ACTUAL 2014-05-08 14:48:52.000000000
\r
94 > @@ -26,7 +26,11 @@
\r
95 > notmuch_filenames_valid
\r
96 > notmuch_message_add_tag
\r
97 > notmuch_message_destroy
\r
98 > +notmuch_message_file_close
\r
99 > +notmuch_message_file_get_header
\r
100 > +notmuch_message_file_open
\r
103 OK, what's happening here is that your version of the test, I guess
\r
104 using nm, is not skipping hidden symbols. This should probably be better
\r
105 documented in the existing test, but in the case of hidden symbols,
\r
106 $6 is ".hidden". I don't know if nm understands symbol visibility at
\r
107 all; I'd guess not.
\r
109 So as a more portable workaround, I agree we could start being more
\r
110 rigorous about not naming things "^notmuch_.*" unless they are intended
\r
113 > This output was a clear motivation for the patch in
\r
114 > id:1399402716-13714-1-git-send-email-cceleri@cs.stanford.edu.
\r
116 I see that now. I think I'd prefer a more minimal patch that only adds _
\r
117 to the front of symbols currently starting with notmuch.
\r
119 > Here is some of output of the matches made on the output of nm:
\r
121 > $ nm -g test/../lib/*.o | sed -n '/.*\s\+T\s\+_\(notmuch_.*\)/p'
\r
122 > 00000000000028c0 T _notmuch_database_add_message
\r
123 > 0000000000002280 T _notmuch_database_begin_atomic
\r
124 > 0000000000001af0 T _notmuch_database_close
\r
125 > 0000000000001de0 T _notmuch_database_compact
\r
127 With GNU nm, there is no leading _ in front of notmuch here, which is
\r
128 what causes your version of the test to fail for me.
\r