1 Return-Path: <felipe.contreras@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 olra.theworths.org (Postfix) with ESMTP id D5E6E40D16C
\r
6 for <notmuch@notmuchmail.org>; Fri, 29 Oct 2010 16:18:00 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5
\r
12 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
\r
13 DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001]
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id OEbgUecQ3P3Q for <notmuch@notmuchmail.org>;
\r
18 Fri, 29 Oct 2010 16:17:50 -0700 (PDT)
\r
19 Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com
\r
21 by olra.theworths.org (Postfix) with ESMTP id AC61E40D16F
\r
22 for <notmuch@notmuchmail.org>; Fri, 29 Oct 2010 16:17:19 -0700 (PDT)
\r
23 Received: by bwz7 with SMTP id 7so3484576bwz.26
\r
24 for <notmuch@notmuchmail.org>; Fri, 29 Oct 2010 16:17:18 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
26 h=domainkey-signature:mime-version:received:received:in-reply-to
\r
27 :references:date:message-id:subject:from:to:cc:content-type
\r
28 :content-transfer-encoding;
\r
29 bh=F1kdWlxasvvdrehEY0MoemlOMf80bkxp5w3Aqe7Fa0w=;
\r
30 b=Cm4Jtu8xSqlTb1R1G0jmlqUxAHmi6bgJATGt68FIi1YZPEB6S0sCXtE9S/PcgfFuUm
\r
31 gjoHxgCbSOYONgErBMX7Yo50BZTNAPrcnUj/vAiENNd9wIsgJK/rt+ClzjdS5fT0soq4
\r
32 IY8LnmmJiubkG8jYSkDtuP2yY+Onh7CKSu0dg=
\r
33 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
\r
34 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
\r
35 :cc:content-type:content-transfer-encoding;
\r
36 b=LaiGQ5TFiRkO72QSpC7C+Yj31p27/KMtKXduKRjcdlscFviBplj/leVEUnJbPSLChs
\r
37 uGucvHFy93i3fh/MsnXSbWTGvhdb+yJqL3Wu0fEoPxps3TPR+KdKaKY+TB+4vZp15qPG
\r
38 nMUgPd34+0VTJMKYkLPy1RtG2DdJ4IHb/279A=
\r
40 Received: by 10.204.46.33 with SMTP id h33mr10516656bkf.95.1288394238663; Fri,
\r
41 29 Oct 2010 16:17:18 -0700 (PDT)
\r
42 Received: by 10.204.58.204 with HTTP; Fri, 29 Oct 2010 16:17:18 -0700 (PDT)
\r
43 In-Reply-To: <87pqus65pv.fsf@yoom.home.cworth.org>
\r
44 References: <1275735915-22650-1-git-send-email-felipe.contreras@gmail.com>
\r
45 <1275735915-22650-3-git-send-email-felipe.contreras@gmail.com>
\r
46 <87pqus65pv.fsf@yoom.home.cworth.org>
\r
47 Date: Sat, 30 Oct 2010 02:17:18 +0300
\r
48 Message-ID: <AANLkTi=iMwf7tMs6C7EFb7ZMhHFfXsZvqA2SovUOsGZW@mail.gmail.com>
\r
49 Subject: Re: [PATCH 2/3] build: fix DSO dependencies
\r
50 From: Felipe Contreras <felipe.contreras@gmail.com>
\r
51 To: Carl Worth <cworth@cworth.org>
\r
52 Content-Type: text/plain; charset=UTF-8
\r
53 Content-Transfer-Encoding: quoted-printable
\r
54 Cc: notmuch@notmuchmail.org
\r
55 X-BeenThere: notmuch@notmuchmail.org
\r
56 X-Mailman-Version: 2.1.13
\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: Fri, 29 Oct 2010 23:18:01 -0000
\r
71 On Sat, Oct 30, 2010 at 12:37 AM, Carl Worth <cworth@cworth.org> wrote:
\r
72 > On Sat, =C2=A05 Jun 2010 14:05:14 +0300, Felipe Contreras <felipe.contrer=
\r
73 as@gmail.com> wrote:
\r
74 >> At least on Fedora 13, this doesn't link; the linker finds the
\r
75 >> dependencies, and aborts saying we should include them.
\r
77 >> We do need to link at least to what we really use, the linker resolves
\r
78 >> the dependencies of our dependencies at loading time. So let's only
\r
79 >> specify what we use directly.
\r
81 > You're certainly right that the linking was bogus. The notmuch binary
\r
82 > was only linking directly against libnotmuch (which in turned linked
\r
83 > against GMime, Xapian, and talloc). But meanwhile, the notmuch binary
\r
84 > is also directly using GMime and talloc so should be linking directly
\r
87 >> -ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
\r
88 >> =C2=A0FINAL_NOTMUCH_LDFLAGS +=3D $(CONFIGURE_LDFLAGS)
\r
89 >> -FINAL_NOTMUCH_LINKER =3D CXX
\r
92 > But the change above causes the notmuch binary to also link directly
\r
93 > against Xapian, (which the binary does not use directly), so that's
\r
96 Yes, I wanted to fix that in subsequent patches, but my first
\r
97 objective was to get it to build.
\r
99 >> - =C2=A0 =C2=A0 gmime_ldflags=3D$(pkg-config --libs $gmimepc)
\r
100 >> + =C2=A0 =C2=A0 if [ $linker_resolves_library_dependencies =3D "1" ]; th=
\r
102 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 gmime_ldflags=3D"-lgmime-2.6=
\r
103 -lgobject-2.0 -lglib-2.0"
\r
104 >> + =C2=A0 =C2=A0 else
\r
105 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 gmime_ldflags=3D$(pkg-config=
\r
107 >> + =C2=A0 =C2=A0 fi
\r
109 > This part I don't understand. Why is it necessary to avoid using
\r
110 > pkg-config in this case? That sounds to me like a maintenance
\r
111 > nightmare. If the pkg-config information for GMime is wrong then we
\r
112 > should get that fixed, and not workaround it.
\r
114 Well, it's not possible: pkg-config is supposed to work on win32 and
\r
115 osx, so all the dependencies must be there, so:
\r
117 % pkg-config --libs gmime-2.6
\r
118 -pthread -lgmime-2.6 -lgio-2.0 -lgobject-2.0 -lgmodule-2.0
\r
119 -lgthread-2.0 -lrt -lglib-2.0
\r
121 Means we would be linking to many libraries we are not going to use directl=
\r
124 Fortunately, I found the solution after writing that patch:
\r
125 -Wl,--as-needed. With this the linker would automatically figure out
\r
126 that we actually want to link only to -lgmime-2.6 -lgobject-2.0
\r
129 > So, finally, I implemented a much more narrow fix for the linking
\r
130 > problem, (simply adding $(GMIME_LDFLAGS) and $(TALLOC_LDFLAGS) to the
\r
131 > FINAL_NOTMUCH_LDFLAGS assignement).
\r
133 > I tested this by installing binutils-gold on my Debian system. This
\r
134 > caused a compilation failure before my patch, but compilation succeeds
\r
135 > after my patch. I'm optimistic that this means that a Fedora compilation
\r
136 > will work as well now. Can you test that please?
\r
138 Patch #1 is not needed if gmime_ldflags in patch #2 are not changed
\r
139 conditionally, which can be achieved by --as-needed.
\r
141 I just sent my proposed updated patches.
\r