1 Return-Path: <bremner@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 40D2B429E2C
\r
6 for <notmuch@notmuchmail.org>; Tue, 21 Jun 2011 18:08:56 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_MED=-2.3] 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 hUBy2qGv4HzV for <notmuch@notmuchmail.org>;
\r
16 Tue, 21 Jun 2011 18:08:55 -0700 (PDT)
\r
17 Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])
\r
18 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 340B8429E25
\r
21 for <notmuch@notmuchmail.org>; Tue, 21 Jun 2011 18:08:53 -0700 (PDT)
\r
22 Received: from zancas.localnet
\r
23 (fctnnbsc30w-142167176081.pppoe-dynamic.High-Speed.nb.bellaliant.net
\r
24 [142.167.176.81]) (authenticated bits=0)
\r
25 by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id p5M18mI2002058
\r
26 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
\r
27 Tue, 21 Jun 2011 22:08:49 -0300
\r
28 Received: from bremner by zancas.localnet with local (Exim 4.76)
\r
29 (envelope-from <bremner@tethera.net>)
\r
30 id 1QZBw0-0004H4-9P; Tue, 21 Jun 2011 22:08:48 -0300
\r
31 From: david@tethera.net
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [PATCH 1/2] libnotmuch: add linker script to declare only notmuch_*
\r
35 Date: Tue, 21 Jun 2011 22:08:42 -0300
\r
36 Message-Id: <1308704923-14748-2-git-send-email-david@tethera.net>
\r
37 X-Mailer: git-send-email 1.7.5.3
\r
38 In-Reply-To: <1308704923-14748-1-git-send-email-david@tethera.net>
\r
39 References: <1308704923-14748-1-git-send-email-david@tethera.net>
\r
40 Cc: David Bremner <bremner@debian.org>
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Wed, 22 Jun 2011 01:08:56 -0000
\r
55 From: David Bremner <bremner@debian.org>
\r
57 This is closely tied to gcc and particularly gnu ld, but I guess the
\r
58 shared library linking code would need to be adjusted to work on a
\r
59 non-gnu linker anyay.
\r
61 I had to make a few not-obviously related changes to the
\r
62 lib/Makefile.local to make this work: libnotmuch_modules is defined
\r
63 with := and used in place of $^
\r
65 lib/Makefile.local | 17 ++++++++++++-----
\r
66 1 files changed, 12 insertions(+), 5 deletions(-)
\r
68 diff --git a/lib/Makefile.local b/lib/Makefile.local
\r
69 index 4319023..4676504 100644
\r
70 --- a/lib/Makefile.local
\r
71 +++ b/lib/Makefile.local
\r
72 @@ -36,7 +36,7 @@ LIBRARY_SUFFIX = so
\r
73 LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
\r
74 SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)
\r
75 LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
\r
76 -LIBRARY_LINK_FLAG = -shared -Wl,-soname=$(SONAME)
\r
77 +LIBRARY_LINK_FLAG = -shared -Wl,--version-script=notmuch.sym,-soname=$(SONAME)
\r
78 ifeq ($(LIBDIR_IN_LDCONFIG),1)
\r
80 LIBRARY_INSTALL_POST_COMMAND=ldconfig
\r
81 @@ -66,13 +66,20 @@ libnotmuch_cxx_srcs = \
\r
85 -libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
\r
86 +libnotmuch_modules := $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
\r
88 $(dir)/libnotmuch.a: $(libnotmuch_modules)
\r
89 $(call quiet,AR) rcs $@ $^
\r
91 -$(dir)/$(LIBNAME): $(libnotmuch_modules)
\r
92 - $(call quiet,CXX $(CXXFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@
\r
93 +$(dir)/$(LIBNAME): $(libnotmuch_modules) notmuch.sym
\r
94 + echo $(libnotmuch_modules)
\r
95 + $(call quiet,CXX $(CXXFLAGS)) $(libnotmuch_modules) $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@
\r
97 +notmuch.sym: lib/notmuch.h
\r
98 + gcc -aux-info notmuch.aux $<
\r
99 + printf "{\nglobal:\n" > notmuch.sym
\r
100 + sed -n 's/.*\(notmuch_[a-z_]*\) (.*/\t\1;/p' notmuch.aux >> notmuch.sym
\r
101 + printf "local: *;\n};\n" >> notmuch.sym
\r
103 $(dir)/$(SONAME): $(dir)/$(LIBNAME)
\r
104 ln -sf $(LIBNAME) $@
\r
105 @@ -96,4 +103,4 @@ install-$(dir): $(dir)/$(LIBNAME)
\r
106 $(LIBRARY_INSTALL_POST_COMMAND)
\r
108 SRCS := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)
\r
109 -CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/$(SONAME) $(dir)/$(LINKER_NAME) $(dir)$(LIBNAME) libnotmuch.a
\r
110 +CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/$(SONAME) $(dir)/$(LINKER_NAME) $(dir)$(LIBNAME) libnotmuch.a notmuch.aux notmuch.sym
\r