unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH 2/3] build: fix DSO dependencies
Date: Sat,  5 Jun 2010 14:05:14 +0300	[thread overview]
Message-ID: <1275735915-22650-3-git-send-email-felipe.contreras@gmail.com> (raw)
In-Reply-To: <1275735915-22650-1-git-send-email-felipe.contreras@gmail.com>

At least on Fedora 13, this doesn't link; the linker finds the
dependencies, and aborts saying we should include them.

/usr/bin/ld: gmime-filter-reply.o: undefined reference to symbol 'g_mime_filter_set_size'
/usr/bin/ld: note: 'g_mime_filter_set_size' is defined in DSO /usr/lib/libgmime-2.6.so.0 so try adding it to the linker command line
/usr/lib/libgmime-2.6.so.0: could not read symbols: Invalid operation

We do need to link at least to what we really use, the linker resolves
the dependencies of our dependencies at loading time. So let's only
specify what we use directly.

For more information, see:
https://fedoraproject.org/wiki/UnderstandingDSOLinkChange

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---

NOTE: I'm not sure about using $(CC) as a linker in !linux platforms, but if
that doesn't work, there's already an 'ifeq' that checks for that so it can be
moved there.

 Makefile.local |    3 ---
 configure      |   11 +++++------
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index bc61a3c..cc8b23b 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -33,10 +33,7 @@ FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE
 FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags)
 FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Llib -lnotmuch
 FINAL_NOTMUCH_LINKER = CC
-ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
 FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS)
-FINAL_NOTMUCH_LINKER = CXX
-endif
 ifeq ($(PLATFORM),LINUX)
 ifeq ($(LIBDIR_IN_LDCONFIG),0)
 FINAL_NOTMUCH_LDFLAGS += -Wl,--enable-new-dtags -Wl,-rpath,$(libdir)
diff --git a/configure b/configure
index 1eb4785..ff775f0 100755
--- a/configure
+++ b/configure
@@ -255,7 +255,11 @@ for gmimepc in gmime-2.6 gmime-2.4; do
 	printf "Yes ($gmimepc).\n"
 	have_gmime=1
 	gmime_cflags=$(pkg-config --cflags $gmimepc)
-	gmime_ldflags=$(pkg-config --libs $gmimepc)
+	if [ $linker_resolves_library_dependencies = "1" ]; then
+		gmime_ldflags="-lgmime-2.6 -lgobject-2.0 -lglib-2.0"
+	else
+		gmime_ldflags=$(pkg-config --libs $gmimepc)
+	fi
     fi
 done
 if [ "$have_gmime" = "0" ]; then
@@ -481,11 +485,6 @@ HAVE_STRCASESTR = ${have_strcasestr}
 # Supported platforms (so far) are: LINUX, MACOSX, SOLARIS
 PLATFORM = ${platform}
 
-# Whether the linker will automatically resolve the dependency of one
-# library on another (if not, then linking a binary requires linking
-# directly against both)
-LINKER_RESOLVES_LIBRARY_DEPENDENCIES = ${linker_resolves_library_dependencies}
-
 # Flags needed to compile and link against Xapian
 XAPIAN_CXXFLAGS = ${xapian_cxxflags}
 XAPIAN_LDFLAGS = ${xapian_ldflags}
-- 
1.7.0.1

  parent reply	other threads:[~2010-06-05 11:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-05 11:05 [PATCH 0/3] build fixes Felipe Contreras
2010-06-05 11:05 ` [PATCH 1/3] configure: check platform beforehand Felipe Contreras
2010-06-05 11:05 ` Felipe Contreras [this message]
2010-10-29 21:37   ` [PATCH 2/3] build: fix DSO dependencies Carl Worth
2010-10-29 23:17     ` Felipe Contreras
2010-11-01 19:58       ` Jed Brown
2010-06-05 11:05 ` [PATCH 3/3] configure: optimize uname finding a bit Felipe Contreras
2010-06-14 14:17 ` [PATCH 0/3] build fixes Felipe Contreras
2010-06-15 19:34   ` Dirk Hohndel
2010-07-17 12:58     ` Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1275735915-22650-3-git-send-email-felipe.contreras@gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).