[PATCH] libnotmuch: build symbols list without relying on gcc -aux-info.
authordavid <david@tethera.net>
Mon, 27 Jun 2011 02:42:25 +0000 (23:42 +2100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:43 +0000 (09:38 -0800)
7f/0acd26974c4ec0eb14b30e31f7eeffc47bdcbb [new file with mode: 0644]

diff --git a/7f/0acd26974c4ec0eb14b30e31f7eeffc47bdcbb b/7f/0acd26974c4ec0eb14b30e31f7eeffc47bdcbb
new file mode 100644 (file)
index 0000000..795e3b9
--- /dev/null
@@ -0,0 +1,103 @@
+Return-Path: <bremner@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id A7F98429E2E\r
+       for <notmuch@notmuchmail.org>; Sun, 26 Jun 2011 19:42:43 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id ZSYEhnl-OGf1 for <notmuch@notmuchmail.org>;\r
+       Sun, 26 Jun 2011 19:42:43 -0700 (PDT)\r
+Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 00ED9431FD0\r
+       for <notmuch@notmuchmail.org>; Sun, 26 Jun 2011 19:42:42 -0700 (PDT)\r
+Received: from zancas.localnet\r
+       (fctnnbsc30w-142167176081.pppoe-dynamic.High-Speed.nb.bellaliant.net\r
+       [142.167.176.81]) (authenticated bits=0)\r
+       by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id p5R2gbCk030272\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);\r
+       Sun, 26 Jun 2011 23:42:38 -0300\r
+Received: from bremner by zancas.localnet with local (Exim 4.76)\r
+       (envelope-from <bremner@tethera.net>)\r
+       id 1Qb1mX-0007y0-Dq; Sun, 26 Jun 2011 23:42:37 -0300\r
+From: david@tethera.net\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] libnotmuch: build symbols list without relying on gcc\r
+       -aux-info.\r
+Date: Sun, 26 Jun 2011 23:42:25 -0300\r
+Message-Id: <1309142545-30590-1-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <1309136932-21910-1-git-send-email-david@tethera.net>\r
+References: <1309136932-21910-1-git-send-email-david@tethera.net>\r
+Cc: David Bremner <bremner@debian.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 27 Jun 2011 02:42:43 -0000\r
+\r
+From: David Bremner <bremner@debian.org>\r
+\r
+Carl reports "gcc -aux-info notmuch.aux lib/notmuch.h" does not\r
+generate notmuch.aux for him with Debian gcc 4.6.0-8.\r
+\r
+Based on a suggestion by Austin Clements, this version uses objdump to\r
+get the symbols from the object files.\r
+\r
+Any symbol that\r
+\r
+    - is in some object file in $(libnotmuch_modules), and\r
+    - starts with notmuch_\r
+\r
+will be exported.\r
+---\r
+\r
+ Here is another way of doing this, probably better unless you are\r
+ very attached to the idea of declaring the API in the header file.\r
\r
+\r
+ lib/Makefile.local |    7 +++----\r
+ 1 files changed, 3 insertions(+), 4 deletions(-)\r
+\r
+diff --git a/lib/Makefile.local b/lib/Makefile.local\r
+index a33ba34..38913c6 100644\r
+--- a/lib/Makefile.local\r
++++ b/lib/Makefile.local\r
+@@ -75,10 +75,9 @@ $(dir)/$(LIBNAME): $(libnotmuch_modules) notmuch.sym\r
+       echo $(libnotmuch_modules)\r
+       $(call quiet,CXX $(CXXFLAGS)) $(libnotmuch_modules) $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@\r
\r
+-notmuch.sym: lib/notmuch.h\r
+-      gcc -aux-info notmuch.aux $<\r
++notmuch.sym: $(libnotmuch_modules)\r
+       printf "{\nglobal:\n" > notmuch.sym\r
+-      sed  -n 's/.*\(notmuch_[a-z_]*\) (.*/\t\1;/p' notmuch.aux >> notmuch.sym\r
++      objdump -t $(libnotmuch_modules)| awk '$$4 == ".text" && $$6 ~ "^notmuch" {print "\t"$$6";"}' >>notmuch.sym\r
+       printf "local: *;\n};\n" >> notmuch.sym\r
\r
+ $(dir)/$(SONAME): $(dir)/$(LIBNAME)\r
+@@ -103,4 +102,4 @@ install-$(dir): $(dir)/$(LIBNAME)\r
+       $(LIBRARY_INSTALL_POST_COMMAND)\r
\r
+ SRCS  := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)\r
+-CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/$(SONAME) $(dir)/$(LINKER_NAME) $(dir)$(LIBNAME) libnotmuch.a notmuch.aux notmuch.sym\r
++CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/$(SONAME) $(dir)/$(LINKER_NAME) $(dir)$(LIBNAME) libnotmuch.a notmuch.sym\r
+-- \r
+1.7.5.4\r
+\r